pub enum CheckError {
Show 62 variants
UnknownFunction {
name: String,
},
DuplicateExternFunction {
name: String,
first_decl: SourceSpan,
redecl: SourceSpan,
},
InvalidCallTarget,
ArityMismatch {
function: String,
expected: usize,
actual: usize,
},
AmbiguousEnumVariantConstructor {
variant: String,
candidates: String,
},
InvalidArgForm {
function: String,
param: String,
reason: &'static str,
},
UnknownIdentifier {
name: String,
},
UnsupportedTypeExpr,
ReturnTypeOwnershipNotAllowed,
UnknownTypeConstructor {
name: String,
},
DuplicateStructDecl {
name: String,
},
DuplicateEnumDecl {
name: String,
},
DuplicateStructTypeParam {
name: String,
param: String,
},
DuplicateStructField {
name: String,
field: String,
},
DuplicateEnumVariant {
name: String,
variant: String,
},
MissingTypeArgs {
name: String,
},
TypeArgCountMismatch {
name: String,
expected: usize,
actual: usize,
},
TypeMismatch {
expected: Ty,
actual: Ty,
},
IfConditionNotBool {
actual: Ty,
},
IfBindingNotPointer {
actual: Ty,
},
MutableIfBindingRequiresBinding,
WhileConditionNotBool {
actual: Ty,
},
MatchSubjectNotEnum {
actual: Ty,
},
UnknownEnumVariant {
enum_name: String,
variant: String,
},
DuplicateMatchVariant {
enum_name: String,
variant: String,
},
MatchVariantArityMismatch {
enum_name: String,
variant: String,
expected: usize,
actual: usize,
},
UnreachableMatchArm,
NonExhaustiveMatch {
enum_name: String,
missing: String,
},
ForIterableNotCollection {
actual: Ty,
},
EmptyArrayNeedsContext,
EmptyArrayWithNonArrayContext {
actual: Ty,
},
HeterogeneousArray {
expected: Ty,
actual: Ty,
},
SliceBaseNotCollection {
actual: Ty,
},
IndexBaseNotCollection {
actual: Ty,
},
CannotCopySliceView,
PrefixRequiresBinding {
op: &'static str,
},
CannotMutBorrowReadOnlyBinding {
name: String,
},
CannotAssignReadOnlyBinding {
name: String,
},
CannotReadWhileMutBorrowed {
place: String,
},
CannotWriteWhileBorrowed {
place: String,
},
CannotBorrowSharedWhileMutBorrowed {
place: String,
},
CannotBorrowMutWhileBorrowed {
place: String,
},
CannotMoveBorrowedBinding {
name: String,
},
PrefixOnlyValidInCallArgs {
op: &'static str,
},
UnaryNegRequiresInt {
actual: Ty,
},
IntArithmeticRequiresInt {
op: &'static str,
lhs: Ty,
rhs: Ty,
},
AmbiguousNumericLiteral {
literal: String,
},
InvalidNumericLiteral {
literal: String,
},
NumericLiteralOutOfRange {
literal: String,
ty: Ty,
},
UnknownStructField {
name: String,
field: String,
},
MissingStructField {
name: String,
field: String,
},
DuplicateStructLiteralField {
name: String,
field: String,
},
StructTypeArgsNotInferred {
name: String,
},
UnexpectedCallTypeArgs {
function: String,
},
GenericTypePastElaboration {
name: String,
},
FieldAccessNotStruct {
actual: Ty,
},
InvalidPointerPayload {
ty: Ty,
},
InvalidMoveAssignmentSource,
UseAfterMove {
name: String,
},
ReturnTypeMismatch {
function: String,
expected: Ty,
actual: Ty,
},
UnexpectedRuntimeSplice,
RecursiveValueType {
name: String,
},
}Expand description
Semantic checking error produced from HIR validation.
Variants§
UnknownFunction
Called function name could not be resolved.
DuplicateExternFunction
Same extern function was declared more than once.
Fields
first_decl: SourceSpanSpan of the first declaration.
redecl: SourceSpanSpan of the duplicate declaration.
InvalidCallTarget
Callee expression was not an identifier.
ArityMismatch
Function call argument count did not match the signature.
Fields
AmbiguousEnumVariantConstructor
Unqualified enum variant constructor resolved to multiple enums.
Fields
InvalidArgForm
Call argument syntax was incompatible with the parameter mode.
Fields
UnknownIdentifier
Referenced identifier was not found in scope.
UnsupportedTypeExpr
Type expression form is not valid in runtime signatures.
ReturnTypeOwnershipNotAllowed
Function or extern return type used an ownership sigil.
UnknownTypeConstructor
Type constructor name was not found.
DuplicateStructDecl
Struct declaration duplicated an existing type name.
DuplicateEnumDecl
Enum declaration duplicated an existing type name.
DuplicateStructTypeParam
Struct declaration repeated a generic type parameter.
DuplicateStructField
Struct declaration repeated a field name.
DuplicateEnumVariant
Enum declaration repeated a variant name.
MissingTypeArgs
Generic type constructor was used without arguments.
TypeArgCountMismatch
Generic type constructor was called with wrong arity.
Fields
TypeMismatch
Inferred and expected types were not compatible.
IfConditionNotBool
if condition did not evaluate to Bool.
IfBindingNotPointer
Pointer binding if condition was not a pointer.
MutableIfBindingRequiresBinding
Mutable pointer binding lacked a named source binding.
WhileConditionNotBool
while condition did not evaluate to Bool.
MatchSubjectNotEnum
match subject was not an enum value.
UnknownEnumVariant
Match arm referenced an unknown enum variant.
Fields
DuplicateMatchVariant
Match contained duplicate variant arms.
MatchVariantArityMismatch
Match arm bound the wrong number of payload names.
Fields
UnreachableMatchArm
Match arm appeared after a wildcard arm.
NonExhaustiveMatch
Match expression did not cover all enum variants.
Fields
ForIterableNotCollection
for iterable expression was not an array or slice.
EmptyArrayNeedsContext
Empty array literal needed type context but none was available.
EmptyArrayWithNonArrayContext
Empty array literal was used with non-collection type context.
HeterogeneousArray
Array literal contained incompatible element types.
SliceBaseNotCollection
Slice base expression was not an array or slice.
IndexBaseNotCollection
Index base expression was not an array or slice.
CannotCopySliceView
Slice view value was copied into an owned context.
PrefixRequiresBinding
Prefix operator was used on a non-binding expression.
CannotMutBorrowReadOnlyBinding
Mutable borrow was requested from a read-only binding.
CannotAssignReadOnlyBinding
Assignment attempted through a read-only binding.
CannotReadWhileMutBorrowed
Read attempted while mutable borrow was active.
CannotWriteWhileBorrowed
Write attempted while overlapping borrows were active.
Shared borrow attempted while mutable borrow was active.
CannotBorrowMutWhileBorrowed
Mutable borrow attempted while overlapping borrows were active.
CannotMoveBorrowedBinding
Move attempted from a borrowed binding.
PrefixOnlyValidInCallArgs
Prefix operator was used outside call arguments.
UnaryNegRequiresInt
Unary negation operand was not an integer.
IntArithmeticRequiresInt
Integer operator was applied to non-integer operands.
Fields
AmbiguousNumericLiteral
Number literal did not provide enough type information.
InvalidNumericLiteral
Number literal could not be parsed.
NumericLiteralOutOfRange
Number literal is out of range for the inferred type.
UnknownStructField
Struct literal referenced an unknown field.
MissingStructField
Struct literal omitted a required field.
DuplicateStructLiteralField
Struct literal repeated a field assignment.
StructTypeArgsNotInferred
Struct type arguments could not be inferred.
UnexpectedCallTypeArgs
Call supplied type arguments to a non-generic function.
GenericTypePastElaboration
Generic type survived past elaboration.
FieldAccessNotStruct
Field access base expression was not a struct.
InvalidPointerPayload
Pointer payload type would introduce unsupported indirection.
InvalidMoveAssignmentSource
Move assignment source was not a named binding.
UseAfterMove
Binding was used after its value had been moved.
ReturnTypeMismatch
Function body produced a value with the wrong return type.
Fields
UnexpectedRuntimeSplice
Meta splice reached runtime semantic checking unexpectedly.
RecursiveValueType
One value type recursively contains itself without pointer indirection.
Trait Implementations§
Source§impl Clone for CheckError
impl Clone for CheckError
Source§fn clone(&self) -> CheckError
fn clone(&self) -> CheckError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CheckError
impl Debug for CheckError
Source§impl Display for CheckError
impl Display for CheckError
Source§impl Error for CheckError
impl Error for CheckError
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
Source§impl<DE> From<CheckError> for CompileError<DE>where
DE: Error + 'static,
impl<DE> From<CheckError> for CompileError<DE>where
DE: Error + 'static,
Source§fn from(source: CheckError) -> Self
fn from(source: CheckError) -> Self
Source§impl PartialEq for CheckError
impl PartialEq for CheckError
impl Eq for CheckError
impl StructuralPartialEq for CheckError
Auto Trait Implementations§
impl Freeze for CheckError
impl RefUnwindSafe for CheckError
impl Send for CheckError
impl Sync for CheckError
impl Unpin for CheckError
impl UnwindSafe for CheckError
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<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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.