Enum TcErr

Source
pub enum TcErr<V: ContextSensitiveVariant> {
    KeyEquation(TcKey, TcKey, V::Err),
    Bound(TcKey, Option<TcKey>, V::Err),
    ChildAccessOutOfBound(TcKey, V, usize),
    ArityMismatch {
        key: TcKey,
        variant: V,
        inferred_arity: usize,
        reported_arity: usize,
    },
    Construction(TcKey, Preliminary<V>, V::Err),
    ChildConstruction(TcKey, usize, Preliminary<V>, V::Err),
    CyclicGraph,
}
Expand description

Represents an error during the type check procedure.

Variants§

§

KeyEquation(TcKey, TcKey, V::Err)

Two keys were attempted to be equated and their underlying types turned out to be incompatible. Contains the two keys and the error that occurred when attempting to meet their ContextSensitiveVariant types.

§

Bound(TcKey, Option<TcKey>, V::Err)

An explicit type bound imposed on a key turned out to be incompatible with the type inferred based on remaining information on the key. Contains the key and the error that occurred when meeting the explicit bound with the inferred type variant.

§

ChildAccessOutOfBound(TcKey, V, usize)

This error occurs when a constraint accesses the nth child of a type and its variant turns out to only have k < n sub-types. Contains the affected key, its inferred or explicitly assigned variant, and the index of the child that was attempted to be accessed.

§

ArityMismatch

This error occurs if the type checker inferred a specific arity but the variant reports a fixed arity that is lower than the inferred one.

Fields

§key: TcKey

The key for which the mismatch was detected.

§variant: V

The variant with fixed arity.

§inferred_arity: usize

The least required arity according to the type check procedure.

§reported_arity: usize

The arity required according to the meet operation that created the variant.

§

Construction(TcKey, Preliminary<V>, V::Err)

An error reporting a failed type construction. Contains the affected key, the preliminary result for which the construction failed, and the error reported by the construction.

§

ChildConstruction(TcKey, usize, Preliminary<V>, V::Err)

This error indicates that a variant requires children, for one of which the construction failed. Note that this can occur seemingly-spuriously, e.g., if a child needs to be present but there were no restrictions on said child. In this case, the construction attempts and might fail to construct a child out of a ContextSensitiveVariant::top(). The error contains the affected key, the index of the child, the preliminary result of which a child construction failed, and the error reported by the construction of the child.

§

CyclicGraph

This error reports cyclic non-equality dependencies in the constraint graph. Example: Key 1 is more concrete than Key 2, which is more concrete than Key 3, which is more concrete than Key 1.

Trait Implementations§

Source§

impl<V: Clone + ContextSensitiveVariant> Clone for TcErr<V>
where V::Err: Clone,

Source§

fn clone(&self) -> TcErr<V>

Returns a duplicate 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<V: Debug + ContextSensitiveVariant> Debug for TcErr<V>
where V::Err: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<V> Freeze for TcErr<V>

§

impl<V> RefUnwindSafe for TcErr<V>

§

impl<V> Send for TcErr<V>
where <V as ContextSensitiveVariant>::Err: Send, V: Send,

§

impl<V> Sync for TcErr<V>
where <V as ContextSensitiveVariant>::Err: Sync, V: Sync,

§

impl<V> Unpin for TcErr<V>

§

impl<V> UnwindSafe for TcErr<V>

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