Enum rusttyc::TcErr[][src]

pub enum TcErr<V: Variant> {
    KeyEquation(TcKeyTcKey, V::Err),
    Bound(TcKeyOption<TcKey>, V::Err),
    ChildAccessOutOfBound(TcKey, V, usize),
    ArityMismatch {
        key: TcKey,
        variant: V,
        inferred_arity: usize,
        reported_arity: usize,
    },
    Construction(TcKeyPreliminary<V>, V::Err),
    ChildConstruction(TcKeyusizePreliminary<V>, V::Err),
}
Expand description

Represents an error during the type check procedure.

Variants

KeyEquation(TcKeyTcKey, V::Err)
Expand description

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 Variant types.

Bound(TcKeyOption<TcKey>, V::Err)
Expand description

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)
Expand description

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
Expand description

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.

Show fields

Fields of ArityMismatch

key: TcKey
Expand description

The key for which the mismatch was detected.

variant: V
Expand description

The variant with fixed arity.

inferred_arity: usize
Expand description

The least required arity according to the type check procedure.

reported_arity: usize
Expand description

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

Construction(TcKeyPreliminary<V>, V::Err)
Expand description

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(TcKeyusizePreliminary<V>, V::Err)
Expand description

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 Variant::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.

Trait Implementations

impl<V: Clone + Variant> Clone for TcErr<V> where
    V::Err: Clone,
    V::Err: Clone,
    V::Err: Clone,
    V::Err: Clone
[src]

fn clone(&self) -> TcErr<V>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<V: Debug + Variant> Debug for TcErr<V> where
    V::Err: Debug,
    V::Err: Debug,
    V::Err: Debug,
    V::Err: Debug
[src]

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<V> RefUnwindSafe for TcErr<V> where
    V: RefUnwindSafe,
    <V as Variant>::Err: RefUnwindSafe

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

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

impl<V> Unpin for TcErr<V> where
    V: Unpin,
    <V as Variant>::Err: Unpin

impl<V> UnwindSafe for TcErr<V> where
    V: UnwindSafe,
    <V as Variant>::Err: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.