Skip to content

Commit 753cd9a

Browse files
committed
Make sure Session.incr_comp_session is only used on one thread
1 parent e82b6c4 commit 753cd9a

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
@@ -127,7 +127,7 @@ pub struct Session {
127127
/// macro name and definition span in the source crate.
128128
pub imported_macro_spans: RefCell<HashMap<Span, (String, Span)>>,
129129

130-
incr_comp_session: RefCell<IncrCompSession>,
130+
incr_comp_session: OneThread<RefCell<IncrCompSession>>,
131131

132132
/// A cache of attributes ignored by StableHashingContext
133133
pub ignored_attr_names: FxHashSet<Symbol>,
@@ -1117,7 +1117,7 @@ pub fn build_session_(
11171117
allocator_kind: Cell::new(None),
11181118
injected_panic_runtime: Cell::new(None),
11191119
imported_macro_spans: RefCell::new(HashMap::new()),
1120-
incr_comp_session: RefCell::new(IncrCompSession::NotInitialized),
1120+
incr_comp_session: OneThread::new(RefCell::new(IncrCompSession::NotInitialized)),
11211121
ignored_attr_names: ich::compute_ignored_attr_names(),
11221122
profile_channel: Lock::new(None),
11231123
perf_stats: PerfStats {

0 commit comments

Comments
 (0)