pub struct GlobalCache<'tcx> {
pub per_item: HashMap<DefId, ItemCache<'tcx>>,
pub def_ids: HashMap<RDefId, DefId>,
pub reverse_item_refs_map: HashMap<ItemRef, GenericArgsRef<'tcx>>,
pub synthetic_item_data: HashMap<SyntheticItem, SyntheticItemData<'tcx>>,
pub disambiguated_crate_names: Option<FxHashMap<CrateNum, (Symbol, u32)>>,
}Expand description
Global caches
Fields§
§per_item: HashMap<DefId, ItemCache<'tcx>>Per-item cache.
def_ids: HashMap<RDefId, DefId>Map rustc def ids to their hax counterpart.
reverse_item_refs_map: HashMap<ItemRef, GenericArgsRef<'tcx>>Map that recovers rustc args for a given ItemRef.
synthetic_item_data: HashMap<SyntheticItem, SyntheticItemData<'tcx>>Data for synthetic items. See the synthetic_items module.
disambiguated_crate_names: Option<FxHashMap<CrateNum, (Symbol, u32)>>Cached names and disambiguators for crate names.
Implementations§
Source§impl<'tcx> GlobalCache<'tcx>
impl<'tcx> GlobalCache<'tcx>
pub fn crate_name( &mut self, tcx: TyCtxt<'tcx>, krate: CrateNum, ) -> (Symbol, u32)
Source§impl<'tcx> GlobalCache<'tcx>
impl<'tcx> GlobalCache<'tcx>
fn synthetic_data( &mut self, s: &impl BaseState<'tcx>, item: SyntheticItem, borrowed_param_def_ids: GenericParamDefIds, ) -> SyntheticItemData<'tcx>
Trait Implementations§
Source§impl<'tcx> Default for GlobalCache<'tcx>
impl<'tcx> Default for GlobalCache<'tcx>
Source§fn default() -> GlobalCache<'tcx>
fn default() -> GlobalCache<'tcx>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'tcx> Freeze for GlobalCache<'tcx>
impl<'tcx> !RefUnwindSafe for GlobalCache<'tcx>
impl<'tcx> !Send for GlobalCache<'tcx>
impl<'tcx> !Sync for GlobalCache<'tcx>
impl<'tcx> Unpin for GlobalCache<'tcx>
impl<'tcx> UnsafeUnpin for GlobalCache<'tcx>
impl<'tcx> !UnwindSafe for GlobalCache<'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
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more