pub enum TypeErrorKind {
Show 15 variants
Mismatch {
expected: Type,
got: Type,
},
OccursCheck {
var: TypeVar,
in_type: Type,
},
UnboundVariable {
name: String,
},
FieldNotFound {
record_type: Type,
field: String,
},
ArityMismatch {
expected: usize,
got: usize,
},
NotAFunction {
got: Type,
},
PatternMismatch {
pattern_type: Type,
scrutinee_type: Type,
},
NotATuple {
got: Type,
},
TupleIndexOutOfBounds {
tuple_type: Type,
index: usize,
size: usize,
},
NotAList {
got: Type,
},
NotAnArray {
got: Type,
},
NotARecord {
got: Type,
},
DuplicateField {
field: String,
},
MissingField {
record_type: Type,
field: String,
},
Custom {
message: String,
},
}Expand description
Different kinds of type errors.
Variants§
Mismatch
Type mismatch between expected and actual types
OccursCheck
Occurs check failed (infinite type)
UnboundVariable
Unbound variable reference
FieldNotFound
Record field not found
ArityMismatch
Function arity mismatch
NotAFunction
Attempted to call a non-function
PatternMismatch
Pattern match type mismatch
NotATuple
Not a tuple (but tuple access was attempted)
TupleIndexOutOfBounds
Tuple index out of bounds
Fields
NotAList
Not a list (but list operation was attempted)
NotAnArray
Not an array (but array operation was attempted)
NotARecord
Not a record (but record operation was attempted)
DuplicateField
Duplicate field in record
MissingField
Missing field in record
Custom
Generic error with custom message
Trait Implementations§
Source§impl Clone for TypeErrorKind
impl Clone for TypeErrorKind
Source§fn clone(&self) -> TypeErrorKind
fn clone(&self) -> TypeErrorKind
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TypeErrorKind
impl RefUnwindSafe for TypeErrorKind
impl Send for TypeErrorKind
impl Sync for TypeErrorKind
impl Unpin for TypeErrorKind
impl UnwindSafe for TypeErrorKind
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)