From 8380539ecb88fba56a8fc0812df6fa52acab4123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Sun, 1 Apr 2018 08:21:49 +0200 Subject: [PATCH] Make sure Session.next_node_id 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 96f41d55454e..81012754a771 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -141,7 +141,7 @@ pub struct Session { /// Data about code being compiled, gathered during compilation. pub code_stats: Lock, - next_node_id: Cell, + next_node_id: OneThread>, /// If -zfuel=crate=n is specified, Some(crate). optimization_fuel_crate: Option, @@ -1107,7 +1107,7 @@ pub fn build_session_( type_length_limit: Once::new(), const_eval_stack_frame_limit: 100, const_eval_step_limit: 1_000_000, - next_node_id: Cell::new(NodeId::new(1)), + next_node_id: OneThread::new(Cell::new(NodeId::new(1))), injected_allocator: Cell::new(None), allocator_kind: Cell::new(None), injected_panic_runtime: Cell::new(None),