Enum arithmetic_typing::error::ErrorContext
source · #[non_exhaustive]pub enum ErrorContext<Prim: PrimitiveType> {
None,
Lvalue(Type<Prim>),
FnDefinition {
args: Tuple<Prim>,
},
FnCall {
definition: Type<Prim>,
call_signature: Type<Prim>,
},
Assignment {
lhs: Type<Prim>,
rhs: Type<Prim>,
},
TypeCast {
source: Type<Prim>,
target: Type<Prim>,
},
UnaryOp(UnaryOpContext<Prim>),
BinaryOp(BinaryOpContext<Prim>),
TupleIndex {
ty: Type<Prim>,
},
ObjectFieldAccess {
ty: Type<Prim>,
},
}
Expand description
Context of a Error
corresponding to a top-level operation that has errored.
Generally, contains resolved types concerning the operation, such as operands of
a binary arithmetic op.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No context.
Lvalue(Type<Prim>)
Processing lvalue (before assignment).
FnDefinition
Function definition.
FnCall
Function call.
Fields
Assignment
Assignment.
Fields
TypeCast
Type cast.
Fields
UnaryOp(UnaryOpContext<Prim>)
Unary operation.
BinaryOp(BinaryOpContext<Prim>)
Binary operation.
TupleIndex
Tuple indexing operation.
ObjectFieldAccess
Field access for an object.
Trait Implementations§
source§impl<Prim: Clone + PrimitiveType> Clone for ErrorContext<Prim>
impl<Prim: Clone + PrimitiveType> Clone for ErrorContext<Prim>
source§fn clone(&self) -> ErrorContext<Prim>
fn clone(&self) -> ErrorContext<Prim>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Prim: Debug + PrimitiveType> Debug for ErrorContext<Prim>
impl<Prim: Debug + PrimitiveType> Debug for ErrorContext<Prim>
source§impl<Prim: PrimitiveType> From<BinaryOpContext<Prim>> for ErrorContext<Prim>
impl<Prim: PrimitiveType> From<BinaryOpContext<Prim>> for ErrorContext<Prim>
source§fn from(value: BinaryOpContext<Prim>) -> Self
fn from(value: BinaryOpContext<Prim>) -> Self
Converts to this type from the input type.
source§impl<Prim: PrimitiveType> From<UnaryOpContext<Prim>> for ErrorContext<Prim>
impl<Prim: PrimitiveType> From<UnaryOpContext<Prim>> for ErrorContext<Prim>
source§fn from(value: UnaryOpContext<Prim>) -> Self
fn from(value: UnaryOpContext<Prim>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<Prim> Freeze for ErrorContext<Prim>where
Prim: Freeze,
impl<Prim> !RefUnwindSafe for ErrorContext<Prim>
impl<Prim> Send for ErrorContext<Prim>
impl<Prim> Sync for ErrorContext<Prim>
impl<Prim> Unpin for ErrorContext<Prim>where
Prim: Unpin,
impl<Prim> !UnwindSafe for ErrorContext<Prim>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)