Rework SESSION_GLOBALS API to prevent overwriting it
This commit is contained in:
committed by
Guillaume Gomez
parent
0cd0709f19
commit
a2654fb64c
@@ -5,7 +5,6 @@
|
||||
// See https://internals.rust-lang.org/t/rfc-compiler-refactoring-spans/1357/28
|
||||
|
||||
use crate::hygiene::SyntaxContext;
|
||||
use crate::SESSION_GLOBALS;
|
||||
use crate::{BytePos, SpanData};
|
||||
|
||||
use rustc_data_structures::fx::FxIndexSet;
|
||||
@@ -122,5 +121,5 @@ impl SpanInterner {
|
||||
// If an interner exists, return it. Otherwise, prepare a fresh one.
|
||||
#[inline]
|
||||
fn with_span_interner<T, F: FnOnce(&mut SpanInterner) -> T>(f: F) -> T {
|
||||
SESSION_GLOBALS.with(|session_globals| f(&mut *session_globals.span_interner.lock()))
|
||||
crate::with_session_globals(|session_globals| f(&mut *session_globals.span_interner.lock()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user