[][src]Struct rustc::ty::context::GlobalCtxt

pub struct GlobalCtxt<'tcx> {
    pub arena: WorkerLocal<Arena<'tcx>>,
    interners: CtxtInterners<'tcx>,
    cstore: Box<CrateStoreDyn>,
    pub sess: &'tcx Session,
    pub lint_store: Lrc<LintStore>,
    pub dep_graph: DepGraph,
    pub prof: SelfProfilerRef,
    pub types: CommonTypes<'tcx>,
    pub lifetimes: CommonLifetimes<'tcx>,
    pub consts: CommonConsts<'tcx>,
    extern_crate_map: NodeMap<CrateNum>,
    trait_map: FxHashMap<DefIndex, FxHashMap<ItemLocalId, StableVec<TraitCandidate>>>,
    export_map: FxHashMap<DefId, Vec<Export<HirId>>>,
    hir_map: Map<'tcx>,
    pub def_path_hash_to_def_id: Option<FxHashMap<DefPathHash, DefId>>,
    pub queries: Queries<'tcx>,
    maybe_unused_trait_imports: FxHashSet<DefId>,
    maybe_unused_extern_crates: Vec<(DefId, Span)>,
    glob_map: FxHashMap<DefId, FxHashSet<Name>>,
    pub extern_prelude: FxHashMap<Name, bool>,
    pub rcache: Lock<FxHashMap<CReaderCacheKey, Ty<'tcx>>>,
    pub selection_cache: SelectionCache<'tcx>,
    pub evaluation_cache: EvaluationCache<'tcx>,
    pub crate_name: Symbol,
    pub data_layout: TargetDataLayout,
    stability_interner: ShardedHashMap<&'tcx Stability, ()>,
    allocation_interner: ShardedHashMap<&'tcx Allocation, ()>,
    pub alloc_map: Lock<AllocMap<'tcx>>,
    layout_interner: ShardedHashMap<&'tcx LayoutDetails, ()>,
    output_filenames: Arc<OutputFilenames>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Fields

arena: WorkerLocal<Arena<'tcx>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

interners: CtxtInterners<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

cstore: Box<CrateStoreDyn>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

sess: &'tcx Session
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

lint_store: Lrc<LintStore>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

dep_graph: DepGraph
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

prof: SelfProfilerRef
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

types: CommonTypes<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Common types, pre-interned for your convenience.

lifetimes: CommonLifetimes<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Common lifetimes, pre-interned for your convenience.

consts: CommonConsts<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Common consts, pre-interned for your convenience.

extern_crate_map: NodeMap<CrateNum>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Resolutions of extern crate items produced by resolver.

trait_map: FxHashMap<DefIndex, FxHashMap<ItemLocalId, StableVec<TraitCandidate>>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

export_map: FxHashMap<DefId, Vec<Export<HirId>>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Export map produced by name resolution.

hir_map: Map<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

def_path_hash_to_def_id: Option<FxHashMap<DefPathHash, DefId>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A map from DefPathHash -> DefId. Includes DefIds from the local crate as well as all upstream crates. Only populated in incremental mode.

queries: Queries<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

maybe_unused_trait_imports: FxHashSet<DefId>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

maybe_unused_extern_crates: Vec<(DefId, Span)>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

glob_map: FxHashMap<DefId, FxHashSet<Name>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

extern_prelude: FxHashMap<Name, bool>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

rcache: Lock<FxHashMap<CReaderCacheKey, Ty<'tcx>>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

selection_cache: SelectionCache<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

data_layout: TargetDataLayout
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Data layout specification for the current target.

stability_interner: ShardedHashMap<&'tcx Stability, ()>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

allocation_interner: ShardedHashMap<&'tcx Allocation, ()>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Stores the value of constants (and deduplicates the actual memory)

alloc_map: Lock<AllocMap<'tcx>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

layout_interner: ShardedHashMap<&'tcx LayoutDetails, ()>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

output_filenames: Arc<OutputFilenames>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Methods

impl<'tcx> GlobalCtxt<'tcx>[src]

pub fn enter_local<F, R>(&'tcx self, f: F) -> R where
    F: FnOnce(TyCtxt<'tcx>) -> R, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Calls the closure with a local TyCtxt using the given arena. interners is a slot passed so we can create a CtxtInterners with the same lifetime as arena.

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

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

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

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

type Error = !

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T[src]

impl<E> SpecializationError for E[src]