Rework SESSION_GLOBALS API to prevent overwriting it

This commit is contained in:
Guillaume Gomez
2021-05-05 21:31:25 +02:00
committed by Guillaume Gomez
parent 0cd0709f19
commit a2654fb64c
27 changed files with 146 additions and 100 deletions

View File

@@ -76,7 +76,7 @@ impl Compiler {
/// Converts strings provided as `--cfg [cfgspec]` into a `crate_cfg`.
pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String>)> {
rustc_span::with_default_session_globals(move || {
rustc_span::create_default_session_if_not_set_then(move |_| {
let cfg = cfgspecs
.into_iter()
.map(|s| {