SessionGlobals in rustc_span - Rust (original) (raw)

Struct SessionGlobals

Source

pub struct SessionGlobals {
    pub(crate) symbol_interner: Interner,
    pub(crate) span_interner: Lock<SpanInterner>,
    pub(crate) metavar_spans: MetavarSpansMap,
    pub(crate) hygiene_data: Lock<HygieneData>,
    pub(crate) source_map: Option<Arc<SourceMap>>,
}

Expand description

Per-session global variables: this struct is stored in thread-local storage in such a way that it is accessible without any kind of handle to all threads within the compilation session, but is not accessible outside the session.

Maps a macro argument token into use of the corresponding metavariable in the macro body. Collisions are possible and processed in maybe_use_metavar_location on best effort basis.

The session’s source map, if there is one. This field should only be used in places where the Session is truly not available, such as<Span as Debug>::fmt.

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. 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: 472 bytes