@@ -57,7 +57,7 @@ use rustc_data_structures::stable_hasher::{HashStable, hash_stable_hashmap,
57
57
StableVec } ;
58
58
use arena:: { TypedArena , SyncDroplessArena } ;
59
59
use rustc_data_structures:: indexed_vec:: IndexVec ;
60
- use rustc_data_structures:: sync:: { Lrc , Lock } ;
60
+ use rustc_data_structures:: sync:: { Lrc , Lock , WorkerLocal } ;
61
61
use std:: any:: Any ;
62
62
use std:: borrow:: Borrow ;
63
63
use std:: cmp:: Ordering ;
@@ -68,7 +68,6 @@ use std::ops::Deref;
68
68
use std:: iter;
69
69
use std:: sync:: mpsc;
70
70
use std:: sync:: Arc ;
71
- use std:: sync:: Mutex ;
72
71
use rustc_target:: spec:: abi;
73
72
use syntax:: ast:: { self , NodeId } ;
74
73
use syntax:: attr;
@@ -80,14 +79,14 @@ use syntax_pos::Span;
80
79
use hir;
81
80
82
81
pub struct AllArenas < ' tcx > {
83
- pub global : GlobalArenas < ' tcx > ,
82
+ pub global : WorkerLocal < GlobalArenas < ' tcx > > ,
84
83
pub interner : SyncDroplessArena ,
85
84
}
86
85
87
86
impl < ' tcx > AllArenas < ' tcx > {
88
87
pub fn new ( ) -> Self {
89
88
AllArenas {
90
- global : GlobalArenas :: new ( ) ,
89
+ global : WorkerLocal :: new ( |_| GlobalArenas :: new ( ) ) ,
91
90
interner : SyncDroplessArena :: new ( ) ,
92
91
}
93
92
}
@@ -850,7 +849,7 @@ impl<'a, 'gcx, 'tcx> Deref for TyCtxt<'a, 'gcx, 'tcx> {
850
849
}
851
850
852
851
pub struct GlobalCtxt < ' tcx > {
853
- global_arenas : & ' tcx GlobalArenas < ' tcx > ,
852
+ global_arenas : & ' tcx WorkerLocal < GlobalArenas < ' tcx > > ,
854
853
global_interners : CtxtInterners < ' tcx > ,
855
854
856
855
cstore : & ' tcx CrateStoreDyn ,
@@ -1756,8 +1755,6 @@ pub mod tls {
1756
1755
use rayon_core;
1757
1756
use dep_graph:: OpenTask ;
1758
1757
use rustc_data_structures:: sync:: { Lrc , Lock } ;
1759
- use std:: sync:: Arc ;
1760
- use std:: sync:: Mutex ;
1761
1758
1762
1759
/// This is the implicit state of rustc. It contains the current
1763
1760
/// TyCtxt and query. It is updated when creating a local interner or
0 commit comments