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>
impl<I> DynSync for CanonicalizerState<I>
impl<I> Freeze for CanonicalizerState<I>
impl<I> RefUnwindSafe for CanonicalizerState<I>where
<I as Interner>::GenericArg: RefUnwindSafe,
<I as Interner>::Ty: RefUnwindSafe,
<I as Interner>::DefId: RefUnwindSafe,
<I as Interner>::Symbol: RefUnwindSafe,
impl<I> Send for CanonicalizerState<I>
impl<I> Sync for CanonicalizerState<I>
impl<I> Unpin for CanonicalizerState<I>
impl<I> UnsafeUnpin for CanonicalizerState<I>
impl<I> UnwindSafe for CanonicalizerState<I>where
<I as Interner>::GenericArg: UnwindSafe,
<I as Interner>::Ty: UnwindSafe,
<I as Interner>::DefId: UnwindSafe,
<I as Interner>::Symbol: 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