@@ -49,7 +49,6 @@ use crate::util::common::ErrorReported;
4949use crate :: util:: nodemap:: { DefIdMap , DefIdSet , ItemLocalMap , ItemLocalSet , NodeMap } ;
5050use crate :: util:: nodemap:: { FxHashMap , FxHashSet } ;
5151
52- use arena:: SyncDroplessArena ;
5352use errors:: DiagnosticBuilder ;
5453use rustc_data_structures:: profiling:: SelfProfilerRef ;
5554use rustc_data_structures:: sharded:: { IntoPointer , ShardedHashMap } ;
@@ -78,21 +77,11 @@ use syntax::expand::allocator::AllocatorKind;
7877use syntax:: source_map:: MultiSpan ;
7978use syntax:: symbol:: { kw, sym, Symbol } ;
8079
81- pub struct AllArenas {
82- pub interner : SyncDroplessArena ,
83- }
84-
85- impl AllArenas {
86- pub fn new ( ) -> Self {
87- AllArenas { interner : SyncDroplessArena :: default ( ) }
88- }
89- }
90-
9180type InternedSet < ' tcx , T > = ShardedHashMap < Interned < ' tcx , T > , ( ) > ;
9281
9382pub struct CtxtInterners < ' tcx > {
9483 /// The arena that types, regions, etc. are allocated from.
95- arena : & ' tcx SyncDroplessArena ,
84+ arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
9685
9786 /// Specifically use a speedy hash algorithm for these hash sets, since
9887 /// they're accessed quite often.
@@ -112,7 +101,7 @@ pub struct CtxtInterners<'tcx> {
112101}
113102
114103impl < ' tcx > CtxtInterners < ' tcx > {
115- fn new ( arena : & ' tcx SyncDroplessArena ) -> CtxtInterners < ' tcx > {
104+ fn new ( arena : & ' tcx WorkerLocal < Arena < ' tcx > > ) -> CtxtInterners < ' tcx > {
116105 CtxtInterners {
117106 arena,
118107 type_ : Default :: default ( ) ,
@@ -1115,7 +1104,6 @@ impl<'tcx> TyCtxt<'tcx> {
11151104 lint_store : Lrc < lint:: LintStore > ,
11161105 local_providers : ty:: query:: Providers < ' tcx > ,
11171106 extern_providers : ty:: query:: Providers < ' tcx > ,
1118- arenas : & ' tcx AllArenas ,
11191107 arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
11201108 resolutions : ty:: ResolverOutputs ,
11211109 hir : hir_map:: Map < ' tcx > ,
@@ -1126,7 +1114,7 @@ impl<'tcx> TyCtxt<'tcx> {
11261114 let data_layout = TargetDataLayout :: parse ( & s. target . target ) . unwrap_or_else ( |err| {
11271115 s. fatal ( & err) ;
11281116 } ) ;
1129- let interners = CtxtInterners :: new ( & arenas . interner ) ;
1117+ let interners = CtxtInterners :: new ( arena ) ;
11301118 let common_types = CommonTypes :: new ( & interners) ;
11311119 let common_lifetimes = CommonLifetimes :: new ( & interners) ;
11321120 let common_consts = CommonConsts :: new ( & interners, & common_types) ;
@@ -2084,7 +2072,7 @@ macro_rules! slice_interners {
20842072 $( impl <' tcx> TyCtxt <' tcx> {
20852073 pub fn $method( self , v: & [ $ty] ) -> & ' tcx List <$ty> {
20862074 self . interners. $field. intern_ref( v, || {
2087- Interned ( List :: from_arena( & self . interners . arena, v) )
2075+ Interned ( List :: from_arena( & * self . arena, v) )
20882076 } ) . 0
20892077 }
20902078 } ) +
0 commit comments