Skip to content

Commit 8380539

Browse files
committed
Make sure Session.next_node_id is only used on one thread
1 parent b0c7bda commit 8380539

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
@@ -141,7 +141,7 @@ pub struct Session {
141141
/// Data about code being compiled, gathered during compilation.
142142
pub code_stats: Lock<CodeStats>,
143143

144-
next_node_id: Cell<ast::NodeId>,
144+
next_node_id: OneThread<Cell<ast::NodeId>>,
145145

146146
/// If -zfuel=crate=n is specified, Some(crate).
147147
optimization_fuel_crate: Option<String>,
@@ -1107,7 +1107,7 @@ pub fn build_session_(
11071107
type_length_limit: Once::new(),
11081108
const_eval_stack_frame_limit: 100,
11091109
const_eval_step_limit: 1_000_000,
1110-
next_node_id: Cell::new(NodeId::new(1)),
1110+
next_node_id: OneThread::new(Cell::new(NodeId::new(1))),
11111111
injected_allocator: Cell::new(None),
11121112
allocator_kind: Cell::new(None),
11131113
injected_panic_runtime: Cell::new(None),

0 commit comments

Comments
 (0)