pub struct ItemCache<'tcx> {
pub def_id: Option<DefId>,
pub full_defs: HashMap<(Option<PromotedId>, Option<GenericArgsRef<'tcx>>), TypeMap<FullDefMapper>>,
pub tys: HashMap<Ty<'tcx>, Ty>,
pub item_refs: HashMap<(RDefId, GenericArgsRef<'tcx>), ItemRef>,
pub predicate_searcher: Option<PredicateSearcher<'tcx>>,
pub impl_exprs: HashMap<PolyTraitRef<'tcx>, ImplExpr>,
}Expand description
Per-item cache
Fields§
§def_id: Option<DefId>The translated DefId.
full_defs: HashMap<(Option<PromotedId>, Option<GenericArgsRef<'tcx>>), TypeMap<FullDefMapper>>The translated definitions, generic in the Body kind.
Each rustc DefId gives several hax DefIds: one for each promoted constant (if any),
and the base one represented by None. Moreover we can instantiate definitions with
generic arguments.
tys: HashMap<Ty<'tcx>, Ty>Cache the Ty translations.
item_refs: HashMap<(RDefId, GenericArgsRef<'tcx>), ItemRef>Cache the ItemRef translations. This is fast because GenericArgsRef is interned.
predicate_searcher: Option<PredicateSearcher<'tcx>>Cache the trait resolution engine for each item.
impl_exprs: HashMap<PolyTraitRef<'tcx>, ImplExpr>Cache of trait refs to resolved impl expressions.
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> Freeze for ItemCache<'tcx>
impl<'tcx> !RefUnwindSafe for ItemCache<'tcx>
impl<'tcx> !Send for ItemCache<'tcx>
impl<'tcx> !Sync for ItemCache<'tcx>
impl<'tcx> Unpin for ItemCache<'tcx>
impl<'tcx> !UnwindSafe for ItemCache<'tcx>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more