Enum CheckError

Source
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.

Fields

§name: String

Function name that failed to resolve.

§

DuplicateExternFunction

Same extern function was declared more than once.

Fields

§name: String

Extern function name.

§first_decl: SourceSpan

Span of the first declaration.

§redecl: SourceSpan

Span of the duplicate declaration.

§

InvalidCallTarget

Callee expression was not an identifier.

§

ArityMismatch

Function call argument count did not match the signature.

Fields

§function: String

Function name receiving the call.

§expected: usize

Number of expected arguments.

§actual: usize

Number of provided arguments.

§

AmbiguousEnumVariantConstructor

Unqualified enum variant constructor resolved to multiple enums.

Fields

§variant: String

Variant name used in the call.

§candidates: String

Rendered list of candidate enum variants.

§

InvalidArgForm

Call argument syntax was incompatible with the parameter mode.

Fields

§function: String

Called function name.

§param: String

Parameter name that rejected the argument.

§reason: &'static str

Human-readable explanation of the mismatch.

§

UnknownIdentifier

Referenced identifier was not found in scope.

Fields

§name: String

Identifier name that failed to resolve.

§

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.

Fields

§name: String

Constructor name that failed to resolve.

§

DuplicateStructDecl

Struct declaration duplicated an existing type name.

Fields

§name: String

Struct name declared more than once.

§

DuplicateEnumDecl

Enum declaration duplicated an existing type name.

Fields

§name: String

Enum name declared more than once.

§

DuplicateStructTypeParam

Struct declaration repeated a generic type parameter.

Fields

§name: String

Struct name.

§param: String

Duplicate type parameter name.

§

DuplicateStructField

Struct declaration repeated a field name.

Fields

§name: String

Struct name.

§field: String

Duplicate field name.

§

DuplicateEnumVariant

Enum declaration repeated a variant name.

Fields

§name: String

Enum name.

§variant: String

Duplicate variant name.

§

MissingTypeArgs

Generic type constructor was used without arguments.

Fields

§name: String

Type constructor name.

§

TypeArgCountMismatch

Generic type constructor was called with wrong arity.

Fields

§name: String

Type constructor name.

§expected: usize

Expected number of type arguments.

§actual: usize

Provided number of type arguments.

§

TypeMismatch

Inferred and expected types were not compatible.

Fields

§expected: Ty

Expected type.

§actual: Ty

Actual inferred type.

§

IfConditionNotBool

if condition did not evaluate to Bool.

Fields

§actual: Ty

Actual condition type.

§

IfBindingNotPointer

Pointer binding if condition was not a pointer.

Fields

§actual: Ty

Actual condition type.

§

MutableIfBindingRequiresBinding

Mutable pointer binding lacked a named source binding.

§

WhileConditionNotBool

while condition did not evaluate to Bool.

Fields

§actual: Ty

Actual condition type.

§

MatchSubjectNotEnum

match subject was not an enum value.

Fields

§actual: Ty

Actual subject type.

§

UnknownEnumVariant

Match arm referenced an unknown enum variant.

Fields

§enum_name: String

Enum name used in the match.

§variant: String

Variant name that failed to resolve.

§

DuplicateMatchVariant

Match contained duplicate variant arms.

Fields

§enum_name: String

Enum name used in the match.

§variant: String

Duplicate variant name.

§

MatchVariantArityMismatch

Match arm bound the wrong number of payload names.

Fields

§enum_name: String

Enum name used in the arm.

§variant: String

Variant name used in the arm.

§expected: usize

Expected payload binder count.

§actual: usize

Actual payload binder count.

§

UnreachableMatchArm

Match arm appeared after a wildcard arm.

§

NonExhaustiveMatch

Match expression did not cover all enum variants.

Fields

§enum_name: String

Enum name being matched.

§missing: String

Comma-separated list of missing variants.

§

ForIterableNotCollection

for iterable expression was not an array or slice.

Fields

§actual: Ty

Actual iterable type.

§

EmptyArrayNeedsContext

Empty array literal needed type context but none was available.

§

EmptyArrayWithNonArrayContext

Empty array literal was used with non-collection type context.

Fields

§actual: Ty

Actual contextual type.

§

HeterogeneousArray

Array literal contained incompatible element types.

Fields

§expected: Ty

Expected element type.

§actual: Ty

Actual element type that mismatched.

§

SliceBaseNotCollection

Slice base expression was not an array or slice.

Fields

§actual: Ty

Actual base expression type.

§

IndexBaseNotCollection

Index base expression was not an array or slice.

Fields

§actual: Ty

Actual base expression type.

§

CannotCopySliceView

Slice view value was copied into an owned context.

§

PrefixRequiresBinding

Prefix operator was used on a non-binding expression.

Fields

§op: &'static str

Prefix operator name.

§

CannotMutBorrowReadOnlyBinding

Mutable borrow was requested from a read-only binding.

Fields

§name: String

Binding name.

§

CannotAssignReadOnlyBinding

Assignment attempted through a read-only binding.

Fields

§name: String

Binding name.

§

CannotReadWhileMutBorrowed

Read attempted while mutable borrow was active.

Fields

§place: String

Place name being read.

§

CannotWriteWhileBorrowed

Write attempted while overlapping borrows were active.

Fields

§place: String

Place name being written.

§

CannotBorrowSharedWhileMutBorrowed

Shared borrow attempted while mutable borrow was active.

Fields

§place: String

Place name being borrowed.

§

CannotBorrowMutWhileBorrowed

Mutable borrow attempted while overlapping borrows were active.

Fields

§place: String

Place name being borrowed.

§

CannotMoveBorrowedBinding

Move attempted from a borrowed binding.

Fields

§name: String

Binding name.

§

PrefixOnlyValidInCallArgs

Prefix operator was used outside call arguments.

Fields

§op: &'static str

Prefix operator name.

§

UnaryNegRequiresInt

Unary negation operand was not an integer.

Fields

§actual: Ty

Actual operand type.

§

IntArithmeticRequiresInt

Integer operator was applied to non-integer operands.

Fields

§op: &'static str

Operator name.

§lhs: Ty

Left-hand operand type.

§rhs: Ty

Right-hand operand type.

§

AmbiguousNumericLiteral

Number literal did not provide enough type information.

Fields

§literal: String

Raw literal text.

§

InvalidNumericLiteral

Number literal could not be parsed.

Fields

§literal: String

Raw literal text.

§

NumericLiteralOutOfRange

Number literal is out of range for the inferred type.

Fields

§literal: String

Raw literal text.

§ty: Ty

Inferred literal type.

§

UnknownStructField

Struct literal referenced an unknown field.

Fields

§name: String

Struct name.

§field: String

Unknown field name.

§

MissingStructField

Struct literal omitted a required field.

Fields

§name: String

Struct name.

§field: String

Missing field name.

§

DuplicateStructLiteralField

Struct literal repeated a field assignment.

Fields

§name: String

Struct name.

§field: String

Duplicate field name.

§

StructTypeArgsNotInferred

Struct type arguments could not be inferred.

Fields

§name: String

Struct name.

§

UnexpectedCallTypeArgs

Call supplied type arguments to a non-generic function.

Fields

§function: String

Function name.

§

GenericTypePastElaboration

Generic type survived past elaboration.

Fields

§name: String

Generic type constructor name.

§

FieldAccessNotStruct

Field access base expression was not a struct.

Fields

§actual: Ty

Actual base expression type.

§

InvalidPointerPayload

Pointer payload type would introduce unsupported indirection.

Fields

§ty: Ty

Rejected pointer payload type.

§

InvalidMoveAssignmentSource

Move assignment source was not a named binding.

§

UseAfterMove

Binding was used after its value had been moved.

Fields

§name: String

Binding name.

§

ReturnTypeMismatch

Function body produced a value with the wrong return type.

Fields

§function: String

Function name.

§expected: Ty

Declared return type.

§actual: Ty

Actual inferred return type.

§

UnexpectedRuntimeSplice

Meta splice reached runtime semantic checking unexpectedly.

§

RecursiveValueType

One value type recursively contains itself without pointer indirection.

Fields

§name: String

Type name participating in the recursive value cycle.

Trait Implementations§

Source§

impl Clone for CheckError

Source§

fn clone(&self) -> CheckError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for CheckError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Error for CheckError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<DE> From<CheckError> for CompileError<DE>
where DE: Error + 'static,

Source§

fn from(source: CheckError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CheckError

Source§

fn eq(&self, other: &CheckError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for CheckError

Source§

impl StructuralPartialEq for CheckError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.