pub struct CanonicalizerState<I: Interner> {
pub variables: ThinVec<I::GenericArg>,
pub var_kinds: Vec<CanonicalVarKind<I>>,
pub variable_lookup_table: HashMap<I::GenericArg, usize>,
pub sub_root_lookup_table: HashMap<TyVid, usize>,
pub cache: DelayedMap<I::Ty, I::Ty>,
}Expand description
State used and modified by a canonicalizer during canonicalization. To avoid many allocations,
this state is reused by many canonicalizers from a single InferCtxt.
Fields§
§variables: ThinVec<I::GenericArg>§var_kinds: Vec<CanonicalVarKind<I>>§variable_lookup_table: HashMap<I::GenericArg, usize>§sub_root_lookup_table: HashMap<TyVid, usize>Maps each sub_unification_table_root_var to the index of the first
variable which used it.
This means in case two type variables have the same sub relations root,
we set the sub_root of the second variable to the position of the first.
Otherwise the sub_root of each type variable is just its own position.
cache: DelayedMap<I::Ty, I::Ty>We can simply cache based on the ty itself, because we use
ty::BoundVarIndexKind::Canonical.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<I> DynSend for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: DynSend,
Vec<CanonicalVarKind<I>>: DynSend,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: DynSend,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: DynSend,
impl<I> DynSync for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: DynSync,
Vec<CanonicalVarKind<I>>: DynSync,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: DynSync,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: DynSync,
impl<I> Freeze for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: Freeze,
Vec<CanonicalVarKind<I>>: Freeze,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: Freeze,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: Freeze,
impl<I> RefUnwindSafe for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: RefUnwindSafe,
Vec<CanonicalVarKind<I>>: RefUnwindSafe,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: RefUnwindSafe,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: RefUnwindSafe,
impl<I> Send for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: Send,
Vec<CanonicalVarKind<I>>: Send,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: Send,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: Send,
impl<I> Sync for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: Sync,
Vec<CanonicalVarKind<I>>: Sync,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: Sync,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: Sync,
impl<I> Unpin for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: Unpin,
Vec<CanonicalVarKind<I>>: Unpin,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: Unpin,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: Unpin,
impl<I> UnsafeUnpin for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: UnsafeUnpin,
Vec<CanonicalVarKind<I>>: UnsafeUnpin,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: UnsafeUnpin,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: UnsafeUnpin,
impl<I> UnwindSafe for CanonicalizerState<I>where
ThinVec<<I as Interner>::GenericArg>: UnwindSafe,
Vec<CanonicalVarKind<I>>: UnwindSafe,
HashMap<<I as Interner>::GenericArg, usize, FxBuildHasher>: UnwindSafe,
DelayedMap<<I as Interner>::Ty, <I as Interner>::Ty>: UnwindSafe,
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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: 136 bytes