pub enum ErrorKind {
Show 86 variants
UnexpectedCharacter(char),
InvalidInteger,
InvalidFloat,
InvalidStringEscape(char),
UnterminatedString,
UnexpectedToken {
expected: Cow<'static, str>,
found: Cow<'static, str>,
},
UnexpectedEof {
expected: Cow<'static, str>,
},
ParseError(String),
NoMainFunction,
UndefinedVariable(String),
UndefinedFunction(String),
AssignToImmutable(String),
UnknownType(String),
UseAfterMove(String),
CannotMoveField {
type_name: String,
field: String,
},
TypeMismatch {
expected: String,
found: String,
},
WrongArgumentCount {
expected: usize,
found: usize,
},
MissingFields(Box<MissingFieldsError>),
UnknownField {
struct_name: String,
field_name: String,
},
DuplicateField {
struct_name: String,
field_name: String,
},
MissingFieldInDestructure {
struct_name: String,
field: String,
},
EmptyStruct,
EmptyAnonEnum,
CopyStructNonCopyField(Box<CopyStructNonCopyFieldError>),
ReservedTypeName {
type_name: String,
},
DuplicateTypeDefinition {
type_name: String,
},
LinearValueNotConsumed(String),
LinearStructCopy(String),
HandleStructMissingMethod {
struct_name: String,
},
HandleMethodWrongSignature {
struct_name: String,
found_signature: String,
},
DuplicateMethod {
type_name: String,
method_name: String,
},
UndefinedMethod {
type_name: String,
method_name: String,
},
UndefinedAssocFn {
type_name: String,
function_name: String,
},
MethodCallOnNonStruct {
found: String,
method_name: String,
},
MethodCalledAsAssocFn {
type_name: String,
method_name: String,
},
AssocFnCalledAsMethod {
type_name: String,
function_name: String,
},
DuplicateDestructor {
type_name: String,
},
DestructorUnknownType {
type_name: String,
},
DuplicateConstant {
name: String,
kind: String,
},
ConstExprNotSupported {
expr_kind: String,
},
DuplicateVariant {
enum_name: String,
variant_name: String,
},
UnknownVariant {
enum_name: String,
variant_name: String,
},
UnknownEnumType(String),
FieldWrongOrder(Box<FieldWrongOrderError>),
FieldAccessOnNonStruct {
found: String,
},
InvalidAssignmentTarget,
InoutNonLvalue,
InoutExclusiveAccess {
variable: String,
},
BorrowNonLvalue,
MutateBorrowedValue {
variable: String,
},
MoveOutOfBorrow {
variable: String,
},
BorrowInoutConflict {
variable: String,
},
InoutKeywordMissing,
BorrowKeywordMissing,
BreakOutsideLoop,
BreakInConsumingForLoop {
element_type: String,
},
ContinueOutsideLoop,
IntrinsicRequiresChecked(String),
UncheckedCallRequiresChecked(String),
NonExhaustiveMatch,
EmptyMatch,
InvalidMatchType(String),
UnknownIntrinsic(String),
IntrinsicWrongArgCount {
name: String,
expected: usize,
found: usize,
},
IntrinsicTypeMismatch(Box<IntrinsicTypeMismatchError>),
ImportRequiresStringLiteral,
ModuleNotFound {
path: String,
candidates: Vec<String>,
},
StdLibNotFound,
PrivateMemberAccess {
item_kind: String,
name: String,
},
UnknownModuleMember {
module_name: String,
member_name: String,
},
LiteralOutOfRange {
value: u64,
ty: String,
},
CannotNegateUnsigned(String),
ChainedComparison,
IndexOnNonArray {
found: String,
},
ArrayLengthMismatch {
expected: u64,
found: u64,
},
IndexOutOfBounds {
index: i64,
length: u64,
},
TypeAnnotationRequired,
MoveOutOfIndex {
element_type: String,
},
LinkError(String),
UnsupportedTarget(String),
PreviewFeatureRequired {
feature: PreviewFeature,
what: String,
},
ComptimeEvaluationFailed {
reason: String,
},
ComptimeArgNotConst {
param_name: String,
},
ComptimeUserError(String),
InternalError(String),
InternalCodegenError(String),
}Expand description
The kind of compilation error.
Variants§
UnexpectedCharacter(char)
InvalidInteger
InvalidFloat
InvalidStringEscape(char)
UnterminatedString
UnexpectedToken
UnexpectedEof
ParseError(String)
A custom parse error with a specific message.
Used for parser-generated errors that don’t fit the “expected X, found Y” pattern.
NoMainFunction
UndefinedVariable(String)
UndefinedFunction(String)
AssignToImmutable(String)
UnknownType(String)
UseAfterMove(String)
Use of a value after it has been moved.
CannotMoveField
Attempt to move a non-copy field out of a struct (banned by ADR-0036).
TypeMismatch
WrongArgumentCount
MissingFields(Box<MissingFieldsError>)
UnknownField
DuplicateField
MissingFieldInDestructure
Missing field in struct destructuring pattern
EmptyStruct
Anonymous struct with no fields is not allowed
EmptyAnonEnum
Anonymous enum with no variants is not allowed
CopyStructNonCopyField(Box<CopyStructNonCopyFieldError>)
@copy struct contains a field with non-Copy type
ReservedTypeName
User-defined type collides with a built-in type name
DuplicateTypeDefinition
Duplicate type definition
LinearValueNotConsumed(String)
Linear value was not consumed before going out of scope
LinearStructCopy(String)
Linear struct cannot be marked @copy
HandleStructMissingMethod
@handle struct missing required .handle() method
HandleMethodWrongSignature
@handle struct’s .handle() method has wrong signature
DuplicateMethod
Duplicate method definition in impl blocks for the same type
UndefinedMethod
Method not found on a type
UndefinedAssocFn
Associated function not found on a type
MethodCallOnNonStruct
Method call on non-struct type
MethodCalledAsAssocFn
Calling a method (with self) as an associated function
AssocFnCalledAsMethod
Calling an associated function (without self) as a method
DuplicateDestructor
Duplicate destructor for the same type
DestructorUnknownType
Destructor for unknown type
DuplicateConstant
Duplicate constant declaration
ConstExprNotSupported
Expression not supported in const context
DuplicateVariant
UnknownVariant
UnknownEnumType(String)
FieldWrongOrder(Box<FieldWrongOrderError>)
FieldAccessOnNonStruct
InvalidAssignmentTarget
InoutNonLvalue
Inout argument is not an lvalue (variable, field, or array element)
InoutExclusiveAccess
Same variable passed to multiple inout parameters in a single call
BorrowNonLvalue
Borrow argument is not an lvalue (variable, field, or array element)
MutateBorrowedValue
Cannot mutate a borrowed value
MoveOutOfBorrow
Cannot move out of a borrowed value
BorrowInoutConflict
Same variable passed to both borrow and inout parameters (law of exclusivity)
InoutKeywordMissing
Argument to inout parameter is missing inout keyword at call site
BorrowKeywordMissing
Argument to borrow parameter is missing borrow keyword at call site
BreakOutsideLoop
BreakInConsumingForLoop
ContinueOutsideLoop
IntrinsicRequiresChecked(String)
UncheckedCallRequiresChecked(String)
NonExhaustiveMatch
EmptyMatch
InvalidMatchType(String)
UnknownIntrinsic(String)
IntrinsicWrongArgCount
IntrinsicTypeMismatch(Box<IntrinsicTypeMismatchError>)
ImportRequiresStringLiteral
ModuleNotFound
StdLibNotFound
PrivateMemberAccess
UnknownModuleMember
LiteralOutOfRange
CannotNegateUnsigned(String)
ChainedComparison
IndexOnNonArray
ArrayLengthMismatch
IndexOutOfBounds
TypeAnnotationRequired
MoveOutOfIndex
Cannot move non-Copy element out of array index position
LinkError(String)
UnsupportedTarget(String)
PreviewFeatureRequired
ComptimeEvaluationFailed
ComptimeArgNotConst
ComptimeUserError(String)
InternalError(String)
InternalCodegenError(String)
Implementations§
Trait Implementations§
Source§impl Error for ErrorKind
impl Error for ErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].