Struct rustc_middle::ty::context::GlobalCtxt[−][src]

pub struct GlobalCtxt<'tcx> {
Show fields pub arena: &'tcx WorkerLocal<Arena<'tcx>>, interners: CtxtInterners<'tcx>, pub(crate) cstore: Box<CrateStoreDyn>, pub sess: &'tcx Session, pub lint_store: Lrc<dyn Any + Sync + Send>, pub dep_graph: DepGraph, pub prof: SelfProfilerRef, pub types: CommonTypes<'tcx>, pub lifetimes: CommonLifetimes<'tcx>, pub consts: CommonConsts<'tcx>, pub visibilities: FxHashMap<LocalDefId, Visibility>, extern_crate_map: FxHashMap<LocalDefId, CrateNum>, trait_map: FxHashMap<LocalDefId, FxHashMap<ItemLocalId, StableVec<TraitCandidate>>>, export_map: ExportMap<LocalDefId>, pub(crate) untracked_crate: &'tcx Crate<'tcx>, pub(crate) definitions: &'tcx Definitions, pub on_disk_cache: Option<OnDiskCache<'tcx>>, pub queries: &'tcx dyn QueryEngine<'tcx>, pub query_caches: QueryCaches<'tcx>, maybe_unused_trait_imports: FxHashSet<LocalDefId>, maybe_unused_extern_crates: Vec<(LocalDefId, Span)>, pub(crate) glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>, pub extern_prelude: FxHashMap<Symbol, bool>, pub ty_rcache: Lock<FxHashMap<CReaderCacheKey, Ty<'tcx>>>, pub pred_rcache: Lock<FxHashMap<CReaderCacheKey, Predicate<'tcx>>>, pub selection_cache: SelectionCache<'tcx>, pub evaluation_cache: EvaluationCache<'tcx>, pub crate_name: Symbol, pub data_layout: TargetDataLayout, stability_interner: ShardedHashMap<&'tcx Stability, ()>, const_stability_interner: ShardedHashMap<&'tcx ConstStability, ()>, pub(crate) alloc_map: Lock<AllocMap<'tcx>>, layout_interner: ShardedHashMap<&'tcx Layout, ()>, output_filenames: Arc<OutputFilenames>,
}

Fields

arena: &'tcx WorkerLocal<Arena<'tcx>>interners: CtxtInterners<'tcx>cstore: Box<CrateStoreDyn>sess: &'tcx Sessionlint_store: Lrc<dyn Any + Sync + Send>

This only ever stores a LintStore but we don’t want a dependency on that type here.

FIXME(Centril): consider dyn LintStoreMarker once we can upcast to Any for some additional type safety.

dep_graph: DepGraphprof: SelfProfilerReftypes: CommonTypes<'tcx>

Common types, pre-interned for your convenience.

lifetimes: CommonLifetimes<'tcx>

Common lifetimes, pre-interned for your convenience.

consts: CommonConsts<'tcx>

Common consts, pre-interned for your convenience.

visibilities: FxHashMap<LocalDefId, Visibility>

Visibilities produced by resolver.

extern_crate_map: FxHashMap<LocalDefId, CrateNum>

Resolutions of extern crate items produced by resolver.

trait_map: FxHashMap<LocalDefId, FxHashMap<ItemLocalId, StableVec<TraitCandidate>>>

Map indicating what traits are in scope for places where this is relevant; generated by resolve.

export_map: ExportMap<LocalDefId>

Export map produced by name resolution.

untracked_crate: &'tcx Crate<'tcx>definitions: &'tcx Definitionson_disk_cache: Option<OnDiskCache<'tcx>>

This provides access to the incremental compilation on-disk cache for query results. Do not access this directly. It is only meant to be used by DepGraph::try_mark_green() and the query infrastructure. This is None if we are not incremental compilation mode

queries: &'tcx dyn QueryEngine<'tcx>query_caches: QueryCaches<'tcx>maybe_unused_trait_imports: FxHashSet<LocalDefId>maybe_unused_extern_crates: Vec<(LocalDefId, Span)>glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>

A map of glob use to a set of names it actually imports. Currently only used in save-analysis.

extern_prelude: FxHashMap<Symbol, bool>

Extern prelude entries. The value is true if the entry was introduced via extern crate item and not --extern option or compiler built-in.

ty_rcache: Lock<FxHashMap<CReaderCacheKey, Ty<'tcx>>>pred_rcache: Lock<FxHashMap<CReaderCacheKey, Predicate<'tcx>>>selection_cache: SelectionCache<'tcx>

Caches the results of trait selection. This cache is used for things that do not have to do with the parameters in scope.

evaluation_cache: EvaluationCache<'tcx>

Caches the results of trait evaluation. This cache is used for things that do not have to do with the parameters in scope. Merge this with selection_cache?

crate_name: Symbol

The definite name of the current crate after taking into account attributes, commandline parameters, etc.

data_layout: TargetDataLayout

Data layout specification for the current target.

stability_interner: ShardedHashMap<&'tcx Stability, ()>

#[stable] and #[unstable] attributes

const_stability_interner: ShardedHashMap<&'tcx ConstStability, ()>

#[rustc_const_stable] and #[rustc_const_unstable] attributes

alloc_map: Lock<AllocMap<'tcx>>

Stores memory for globals (statics/consts).

layout_interner: ShardedHashMap<&'tcx Layout, ()>output_filenames: Arc<OutputFilenames>

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for GlobalCtxt<'tcx>

impl<'tcx> !Send for GlobalCtxt<'tcx>

impl<'tcx> !Sync for GlobalCtxt<'tcx>

impl<'tcx> Unpin for GlobalCtxt<'tcx>

impl<'tcx> !UnwindSafe for GlobalCtxt<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]