Skip to content

Commit b0c7bda

Browse files
committed
Make Session.code_stats thread-safe
1 parent 904e2b6 commit b0c7bda

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
@@ -139,7 +139,7 @@ pub struct Session {
139139
pub perf_stats: PerfStats,
140140

141141
/// Data about code being compiled, gathered during compilation.
142-
pub code_stats: RefCell<CodeStats>,
142+
pub code_stats: Lock<CodeStats>,
143143

144144
next_node_id: Cell<ast::NodeId>,
145145

@@ -1122,7 +1122,7 @@ pub fn build_session_(
11221122
normalize_ty_after_erasing_regions: AtomicUsize::new(0),
11231123
normalize_projection_ty: AtomicUsize::new(0),
11241124
},
1125-
code_stats: RefCell::new(CodeStats::new()),
1125+
code_stats: Lock::new(CodeStats::new()),
11261126
optimization_fuel_crate,
11271127
optimization_fuel_limit,
11281128
print_fuel_crate,

0 commit comments

Comments
 (0)