pub struct ParseSess {
Show 17 fields pub dcx: DiagCtxt, pub unstable_features: UnstableFeatures, pub config: Cfg, pub check_config: CheckCfg, pub edition: Edition, pub raw_identifier_spans: AppendOnlyVec<Span>, pub bad_unicode_identifiers: Lock<FxHashMap<Symbol, Vec<Span>>>, source_map: Lrc<SourceMap>, pub buffered_lints: Lock<Vec<BufferedEarlyLint>>, pub ambiguous_block_expr_parse: Lock<FxHashMap<Span, Span>>, pub gated_spans: GatedSpans, pub symbol_gallery: SymbolGallery, pub env_depinfo: Lock<FxHashSet<(Symbol, Option<Symbol>)>>, pub file_depinfo: Lock<FxHashSet<Symbol>>, pub assume_incomplete_release: bool, proc_macro_quoted_spans: AppendOnlyVec<Span>, pub attr_id_generator: AttrIdGenerator,
}
Expand description

Info about a parsing session.

Fields§

§dcx: DiagCtxt§unstable_features: UnstableFeatures§config: Cfg§check_config: CheckCfg§edition: Edition§raw_identifier_spans: AppendOnlyVec<Span>

Places where raw identifiers were used. This is used to avoid complaining about idents clashing with keywords in new editions.

§bad_unicode_identifiers: Lock<FxHashMap<Symbol, Vec<Span>>>

Places where identifiers that contain invalid Unicode codepoints but that look like they should be. Useful to avoid bad tokenization when encountering emoji. We group them to provide a single error per unique incorrect identifier.

§source_map: Lrc<SourceMap>§buffered_lints: Lock<Vec<BufferedEarlyLint>>§ambiguous_block_expr_parse: Lock<FxHashMap<Span, Span>>

Contains the spans of block expressions that could have been incomplete based on the operation token that followed it, but that the parser cannot identify without further analysis.

§gated_spans: GatedSpans§symbol_gallery: SymbolGallery§env_depinfo: Lock<FxHashSet<(Symbol, Option<Symbol>)>>

Environment variables accessed during the build and their values when they exist.

§file_depinfo: Lock<FxHashSet<Symbol>>

File paths accessed during the build.

§assume_incomplete_release: bool

Whether cfg(version) should treat the current release as incomplete

§proc_macro_quoted_spans: AppendOnlyVec<Span>

Spans passed to proc_macro::quote_span. Each span has a numerical identifier represented by its position in the vector.

§attr_id_generator: AttrIdGenerator

Used to generate new AttrIds. Every AttrId is unique.

Implementations§

source§

impl ParseSess

source

pub fn new( locale_resources: Vec<&'static str>, file_path_mapping: FilePathMapping ) -> Self

Used for testing.

source

pub fn with_dcx(dcx: DiagCtxt, source_map: Lrc<SourceMap>) -> Self

source

pub fn with_silent_emitter(fatal_note: Option<String>) -> Self

source

pub fn source_map(&self) -> &SourceMap

source

pub fn clone_source_map(&self) -> Lrc<SourceMap>

source

pub fn buffer_lint( &self, lint: &'static Lint, span: impl Into<MultiSpan>, node_id: NodeId, msg: impl Into<DiagnosticMessage> )

source

pub fn buffer_lint_with_diagnostic( &self, lint: &'static Lint, span: impl Into<MultiSpan>, node_id: NodeId, msg: impl Into<DiagnosticMessage>, diagnostic: BuiltinLintDiagnostics )

source

pub fn save_proc_macro_span(&self, span: Span) -> usize

source

pub fn proc_macro_quoted_spans( &self ) -> impl Iterator<Item = (usize, Span)> + '_

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

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: 888 bytes