From 73b26f7f51d15c6cb6b4495f4ff9a405610037f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Sun, 1 Apr 2018 08:24:31 +0200 Subject: [PATCH] Make sure Session.imported_macro_spans is only used on one thread --- src/librustc/session/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 9ab9635c9eda..731e4feefa0f 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -125,7 +125,7 @@ pub struct Session { /// Map from imported macro spans (which consist of /// the localized span for the macro body) to the /// macro name and definition span in the source crate. - pub imported_macro_spans: RefCell>, + pub imported_macro_spans: OneThread>>, incr_comp_session: OneThread>, @@ -1108,7 +1108,7 @@ pub fn build_session_( injected_allocator: Cell::new(None), allocator_kind: Cell::new(None), injected_panic_runtime: Cell::new(None), - imported_macro_spans: RefCell::new(HashMap::new()), + imported_macro_spans: OneThread::new(RefCell::new(HashMap::new())), incr_comp_session: OneThread::new(RefCell::new(IncrCompSession::NotInitialized)), ignored_attr_names: ich::compute_ignored_attr_names(), profile_channel: Lock::new(None),