pub enum InferTy {
TyVar(TyVid),
IntVar(IntVid),
FloatVar(FloatVid),
FreshTy(u32),
FreshIntTy(u32),
FreshFloatTy(u32),
}Expand description
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)
FreshFloatTy(u32)
Trait Implementations§
Source§impl<CTX> HashStable<CTX> for InferTy
Available on crate feature nightly only.
impl<CTX> HashStable<CTX> for InferTy
nightly only.fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher)
Source§impl Ord for InferTy
impl Ord for InferTy
Source§impl PartialOrd for InferTy
impl PartialOrd for InferTy
impl Copy for InferTy
impl Eq for InferTy
impl StructuralPartialEq for InferTy
Auto Trait Implementations§
impl DynSend for InferTy
impl DynSync for InferTy
impl Freeze for InferTy
impl RefUnwindSafe for InferTy
impl Send for InferTy
impl Sync for InferTy
impl Unpin for InferTy
impl UnwindSafe for InferTy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Size for each variant:
TyVar: 4 bytesIntVar: 4 bytesFloatVar: 4 bytesFreshTy: 4 bytesFreshIntTy: 4 bytesFreshFloatTy: 4 bytes