Enum rustc_middle::ty::InferTy[][src]

pub enum InferTy {
    TyVar(TyVid),
    IntVar(IntVid),
    FloatVar(FloatVid),
    FreshTy(u32),
    FreshIntTy(u32),
    FreshFloatTy(u32),
}

A placeholder for a type that hasn’t been inferred yet.

E.g., if we have an empty array ([]), then we create a fresh type variable for the element type since we won’t know until it’s used what the element type is supposed to be.

Variants

TyVar(TyVid)

A type variable.

IntVar(IntVid)

An integral type variable ({integer}).

These are created when the compiler sees an integer literal like 1 that could be several different types (u8, i32, u32, etc.). We don’t know until it’s used what type it’s supposed to be, so we create a fresh type variable.

FloatVar(FloatVid)

A floating-point type variable ({float}).

These are created when the compiler sees an float literal like 1.0 that could be either an f32 or an f64. We don’t know until it’s used what type it’s supposed to be, so we create a fresh type variable.

FreshTy(u32)

A FreshTy is one that is generated as a replacement for an unbound type variable. This is convenient for caching etc. See rustc_infer::infer::freshen for more details.

Compare with TyVar.

FreshIntTy(u32)

Like FreshTy, but as a replacement for IntVar.

FreshFloatTy(u32)

Like FreshTy, but as a replacement for FloatVar.

Trait Implementations

impl<'tcx> Lift<'tcx> for InferTy[src]

type Lifted = Self

impl<'tcx> TypeFoldable<'tcx> for InferTy[src]

Auto Trait Implementations

impl RefUnwindSafe for InferTy

impl Send for InferTy

impl Sync for InferTy

impl Unpin for InferTy

impl UnwindSafe for InferTy

Blanket Implementations

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

impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
    T: Copy
[src]

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

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

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<Ctxt, T> DepNodeParams<Ctxt> for T where
    T: HashStable<<Ctxt as DepContext>::StableHashingContext> + Debug,
    Ctxt: DepContext
[src]

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

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

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

type Error = !

impl<'tcx, T> Subst<'tcx> for T where
    T: TypeFoldable<'tcx>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.

impl<T> WithConstness for T[src]