expand: Move module file path stack from global session to expansion data

Also don't push the paths on the stack directly in `fn parse_external_mod`, return them instead.
This commit is contained in:
Vadim Petrochenkov 2021-02-21 19:15:43 +03:00
parent bc18eb4717
commit 39052c55bb
7 changed files with 80 additions and 70 deletions

View file

@ -13,7 +13,6 @@ use rustc_span::hygiene::ExpnId;
use rustc_span::source_map::{FilePathMapping, SourceMap};
use rustc_span::{MultiSpan, Span, Symbol};
use std::path::PathBuf;
use std::str;
/// The set of keys (and, optionally, values) that define the compilation
@ -122,8 +121,6 @@ pub struct ParseSess {
pub missing_fragment_specifiers: Lock<FxHashMap<Span, NodeId>>,
/// Places where raw identifiers were used. This is used for feature-gating raw identifiers.
pub raw_identifier_spans: Lock<Vec<Span>>,
/// Used to determine and report recursive module inclusions.
pub included_mod_stack: Lock<Vec<PathBuf>>,
source_map: Lrc<SourceMap>,
pub buffered_lints: Lock<Vec<BufferedEarlyLint>>,
/// Contains the spans of block expressions that could have been incomplete based on the
@ -157,7 +154,6 @@ impl ParseSess {
edition: ExpnId::root().expn_data().edition,
missing_fragment_specifiers: Default::default(),
raw_identifier_spans: Lock::new(Vec::new()),
included_mod_stack: Lock::new(vec![]),
source_map,
buffered_lints: Lock::new(vec![]),
ambiguous_block_expr_parse: Lock::new(FxHashMap::default()),