Skip to main content

CheckError

Enum CheckError 

Source
pub enum CheckError {
Show 18 variants UnresolvedRef { name: String, location: Option<String>, suggestions: Vec<String>, }, DeriveFailed { target: String, trait_name: String, missing_impls: Vec<String>, }, TypeNotFound { type_name: String, }, TraitNotImplemented { type_name: String, trait_name: String, }, SimultaneousMutBorrow { variable: String, first_borrow_line: u32, second_borrow_line: u32, }, BorrowConflict { variable: String, existing_kind: String, existing_line: u32, new_kind: String, new_line: u32, }, UseAfterMove { variable: String, moved_at: u32, used_at: u32, }, DanglingReference { reference: String, source: String, dropped_at: u32, used_at: u32, }, CannotMutateThroughSharedRef { variable: String, at_line: u32, }, FieldNotFound { type_name: String, field_name: String, available_fields: Vec<String>, }, MethodNotFound { type_name: String, method_name: String, available_methods: Vec<String>, }, EnumVariantNotFound { enum_name: String, variant_name: String, available_variants: Vec<String>, }, MissingRequiredField { struct_name: String, missing_fields: Vec<String>, }, ArgumentCountMismatch { function_name: String, expected: usize, actual: usize, }, AmbiguousTarget { name: String, candidates: Vec<String>, }, TypeImpact { description: String, details: String, }, ReferenceIntegrity { description: String, details: String, }, Other { message: String, },
}
Expand description

Error from a light check.

Variants§

§

UnresolvedRef

Unresolved symbol reference.

Fields

§name: String

The symbol name that couldn’t be resolved.

§location: Option<String>

Location context (if available).

§suggestions: Vec<String>

Suggested alternatives (if any).

§

DeriveFailed

Derive macro cannot be applied.

Fields

§target: String

Target type name.

§trait_name: String

Trait that cannot be derived.

§missing_impls: Vec<String>

Field types missing the required trait implementation.

§

TypeNotFound

Type not found in registry.

Fields

§type_name: String

The type name that wasn’t found.

§

TraitNotImplemented

Trait not implemented for type.

Fields

§type_name: String

Type that doesn’t implement the trait.

§trait_name: String

Trait that isn’t implemented.

§

SimultaneousMutBorrow

Simultaneous mutable borrows of the same variable.

Fields

§variable: String

Variable name.

§first_borrow_line: u32

Line of the first mutable borrow.

§second_borrow_line: u32

Line of the second mutable borrow.

§

BorrowConflict

Conflict between mutable and shared borrows.

Fields

§variable: String

Variable name.

§existing_kind: String

Existing borrow kind (“mutable” or “shared”).

§existing_line: u32

Line of the existing borrow.

§new_kind: String

New borrow kind.

§new_line: u32

Line of the new borrow.

§

UseAfterMove

Use of a variable after it has been moved.

Fields

§variable: String

Variable name.

§moved_at: u32

Line where the move occurred.

§used_at: u32

Line where the invalid use occurred.

§

DanglingReference

Dangling reference (reference to dropped value).

Fields

§reference: String

Reference variable name.

§source: String

Source variable name (the dropped value).

§dropped_at: u32

Line where the source was dropped.

§used_at: u32

Line where the reference was used.

§

CannotMutateThroughSharedRef

Cannot mutate through a shared reference.

Fields

§variable: String

Variable name.

§at_line: u32

Line where mutation was attempted.

§

FieldNotFound

Field not found on a type.

Fields

§type_name: String

Type that was accessed.

§field_name: String

Field name that wasn’t found.

§available_fields: Vec<String>

Available fields (for suggestions).

§

MethodNotFound

Method not found on a type.

Fields

§type_name: String

Type that was accessed.

§method_name: String

Method name that wasn’t found.

§available_methods: Vec<String>

Available methods (for suggestions).

§

EnumVariantNotFound

Enum variant not found.

Fields

§enum_name: String

Enum type name.

§variant_name: String

Variant name that wasn’t found.

§available_variants: Vec<String>

Available variants (for suggestions).

§

MissingRequiredField

Missing required field in struct literal.

Fields

§struct_name: String

Struct type name.

§missing_fields: Vec<String>

Missing field names.

§

ArgumentCountMismatch

Function argument count mismatch.

Fields

§function_name: String

Function name.

§expected: usize

Expected argument count.

§actual: usize

Actual argument count.

§

AmbiguousTarget

Ambiguous target - multiple symbols match the given name.

Fields

§name: String

The name that matched multiple symbols.

§candidates: Vec<String>

The matching symbol paths.

§

TypeImpact

Type change has impact on other parts of the codebase.

Fields

§description: String

Description of the impact.

§details: String

Details about the affected areas.

§

ReferenceIntegrity

Reference integrity issue (dangling references, missing fields, etc.).

Fields

§description: String

Description of the issue.

§details: String

Details about the affected areas.

§

Other

Generic check failure.

Fields

§message: String

Error message.

Implementations§

Source§

impl CheckError

Source

pub fn unresolved(name: impl Into<String>) -> Self

Create an unresolved reference error.

Source

pub fn unresolved_at( name: impl Into<String>, location: impl Into<String>, ) -> Self

Create an unresolved reference error with location.

Source

pub fn type_not_found(type_name: impl Into<String>) -> Self

Create a type not found error.

Source

pub fn derive_failed( target: impl Into<String>, trait_name: impl Into<String>, missing_impls: Vec<String>, ) -> Self

Create a derive failed error.

Source

pub fn trait_not_impl( type_name: impl Into<String>, trait_name: impl Into<String>, ) -> Self

Create a trait not implemented error.

Source

pub fn simultaneous_mut_borrow( variable: impl Into<String>, first_borrow_line: u32, second_borrow_line: u32, ) -> Self

Create a simultaneous mutable borrow error.

Source

pub fn borrow_conflict( variable: impl Into<String>, existing_kind: impl Into<String>, existing_line: u32, new_kind: impl Into<String>, new_line: u32, ) -> Self

Create a borrow conflict error.

Source

pub fn use_after_move( variable: impl Into<String>, moved_at: u32, used_at: u32, ) -> Self

Create a use after move error.

Source

pub fn dangling_reference( reference: impl Into<String>, source: impl Into<String>, dropped_at: u32, used_at: u32, ) -> Self

Create a dangling reference error.

Source

pub fn cannot_mutate_shared(variable: impl Into<String>, at_line: u32) -> Self

Create a cannot mutate through shared ref error.

Source

pub fn field_not_found( type_name: impl Into<String>, field_name: impl Into<String>, available_fields: Vec<String>, ) -> Self

Create a field not found error.

Source

pub fn method_not_found( type_name: impl Into<String>, method_name: impl Into<String>, available_methods: Vec<String>, ) -> Self

Create a method not found error.

Source

pub fn variant_not_found( enum_name: impl Into<String>, variant_name: impl Into<String>, available_variants: Vec<String>, ) -> Self

Create an enum variant not found error.

Source

pub fn missing_fields( struct_name: impl Into<String>, missing_fields: Vec<String>, ) -> Self

Create a missing required field error.

Source

pub fn arg_count_mismatch( function_name: impl Into<String>, expected: usize, actual: usize, ) -> Self

Create an argument count mismatch error.

Source

pub fn ambiguous_target( name: impl Into<String>, candidates: Vec<String>, ) -> Self

Create an ambiguous target error.

Source

pub fn type_impact( description: impl Into<String>, details: impl Into<String>, ) -> Self

Create a type impact error.

Source

pub fn reference_integrity( description: impl Into<String>, details: impl Into<String>, ) -> Self

Create a reference integrity error.

Trait Implementations§

Source§

impl Clone for CheckError

Source§

fn clone(&self) -> CheckError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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

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

impl Display for CheckError

Source§

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

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

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
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

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.