Struct rustc_middle::ty::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>,
export_map: ExportMap<LocalDefId>,
pub(crate) untracked_crate: &'tcx Crate<'tcx>,
pub(crate) definitions: 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>,
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>,
pub main_def: Option<MainDefinition>,
pub(super) vtables_cache: Lock<FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>), AllocId>>,
}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.
export_map: ExportMap<LocalDefId>Export map produced by name resolution.
untracked_crate: &'tcx Crate<'tcx>definitions: 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: SymbolThe definite name of the current crate after taking into account attributes, commandline parameters, etc.
data_layout: TargetDataLayoutData 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>main_def: Option<MainDefinition>vtables_cache: Lock<FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>), AllocId>>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
Layout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. 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: 13888 bytes