Skip to content

Commit 73b26f7

Browse files
committed
Make sure Session.imported_macro_spans is only used on one thread
1 parent 271c8d3 commit 73b26f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/session/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub struct Session {
125125
/// Map from imported macro spans (which consist of
126126
/// the localized span for the macro body) to the
127127
/// macro name and definition span in the source crate.
128-
pub imported_macro_spans: RefCell<HashMap<Span, (String, Span)>>,
128+
pub imported_macro_spans: OneThread<RefCell<HashMap<Span, (String, Span)>>>,
129129

130130
incr_comp_session: OneThread<RefCell<IncrCompSession>>,
131131

@@ -1108,7 +1108,7 @@ pub fn build_session_(
11081108
injected_allocator: Cell::new(None),
11091109
allocator_kind: Cell::new(None),
11101110
injected_panic_runtime: Cell::new(None),
1111-
imported_macro_spans: RefCell::new(HashMap::new()),
1111+
imported_macro_spans: OneThread::new(RefCell::new(HashMap::new())),
11121112
incr_comp_session: OneThread::new(RefCell::new(IncrCompSession::NotInitialized)),
11131113
ignored_attr_names: ich::compute_ignored_attr_names(),
11141114
profile_channel: Lock::new(None),

0 commit comments

Comments
 (0)