]> git.lizzy.rs Git - rust.git/commitdiff
Make Session.code_stats thread-safe
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sun, 1 Apr 2018 06:21:34 +0000 (08:21 +0200)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Tue, 10 Apr 2018 12:40:25 +0000 (14:40 +0200)
src/librustc/session/mod.rs

index 6784f909ff358e4626f063a6e3bb3cd1483e50f9..96f41d55454ed0c8a6d8c1e2963f12b50de7d6fb 100644 (file)
@@ -139,7 +139,7 @@ pub struct Session {
     pub perf_stats: PerfStats,
 
     /// Data about code being compiled, gathered during compilation.
-    pub code_stats: RefCell<CodeStats>,
+    pub code_stats: Lock<CodeStats>,
 
     next_node_id: Cell<ast::NodeId>,
 
@@ -1122,7 +1122,7 @@ pub fn build_session_(
             normalize_ty_after_erasing_regions: AtomicUsize::new(0),
             normalize_projection_ty: AtomicUsize::new(0),
         },
-        code_stats: RefCell::new(CodeStats::new()),
+        code_stats: Lock::new(CodeStats::new()),
         optimization_fuel_crate,
         optimization_fuel_limit,
         print_fuel_crate,