@@ -50,7 +50,6 @@ use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex, LOCAL_CRA
5050use rustc_hir:: { HirId , Node , TraitCandidate } ;
5151use rustc_hir:: { ItemKind , ItemLocalId , ItemLocalMap , ItemLocalSet } ;
5252
53- use arena:: SyncDroplessArena ;
5453use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
5554use rustc_data_structures:: profiling:: SelfProfilerRef ;
5655use rustc_data_structures:: sharded:: { IntoPointer , ShardedHashMap } ;
@@ -81,21 +80,11 @@ use syntax::ast;
8180use syntax:: attr;
8281use syntax:: expand:: allocator:: AllocatorKind ;
8382
84- pub struct AllArenas {
85- pub interner : SyncDroplessArena ,
86- }
87-
88- impl AllArenas {
89- pub fn new ( ) -> Self {
90- AllArenas { interner : SyncDroplessArena :: default ( ) }
91- }
92- }
93-
9483type InternedSet < ' tcx , T > = ShardedHashMap < Interned < ' tcx , T > , ( ) > ;
9584
9685pub struct CtxtInterners < ' tcx > {
9786 /// The arena that types, regions, etc. are allocated from.
98- arena : & ' tcx SyncDroplessArena ,
87+ arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
9988
10089 /// Specifically use a speedy hash algorithm for these hash sets, since
10190 /// they're accessed quite often.
@@ -115,7 +104,7 @@ pub struct CtxtInterners<'tcx> {
115104}
116105
117106impl < ' tcx > CtxtInterners < ' tcx > {
118- fn new ( arena : & ' tcx SyncDroplessArena ) -> CtxtInterners < ' tcx > {
107+ fn new ( arena : & ' tcx WorkerLocal < Arena < ' tcx > > ) -> CtxtInterners < ' tcx > {
119108 CtxtInterners {
120109 arena,
121110 type_ : Default :: default ( ) ,
@@ -1118,7 +1107,6 @@ impl<'tcx> TyCtxt<'tcx> {
11181107 lint_store : Lrc < lint:: LintStore > ,
11191108 local_providers : ty:: query:: Providers < ' tcx > ,
11201109 extern_providers : ty:: query:: Providers < ' tcx > ,
1121- arenas : & ' tcx AllArenas ,
11221110 arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
11231111 resolutions : ty:: ResolverOutputs ,
11241112 hir : hir_map:: Map < ' tcx > ,
@@ -1129,7 +1117,7 @@ impl<'tcx> TyCtxt<'tcx> {
11291117 let data_layout = TargetDataLayout :: parse ( & s. target . target ) . unwrap_or_else ( |err| {
11301118 s. fatal ( & err) ;
11311119 } ) ;
1132- let interners = CtxtInterners :: new ( & arenas . interner ) ;
1120+ let interners = CtxtInterners :: new ( arena ) ;
11331121 let common_types = CommonTypes :: new ( & interners) ;
11341122 let common_lifetimes = CommonLifetimes :: new ( & interners) ;
11351123 let common_consts = CommonConsts :: new ( & interners, & common_types) ;
@@ -2087,7 +2075,7 @@ macro_rules! slice_interners {
20872075 $( impl <' tcx> TyCtxt <' tcx> {
20882076 pub fn $method( self , v: & [ $ty] ) -> & ' tcx List <$ty> {
20892077 self . interners. $field. intern_ref( v, || {
2090- Interned ( List :: from_arena( & self . interners . arena, v) )
2078+ Interned ( List :: from_arena( & * self . arena, v) )
20912079 } ) . 0
20922080 }
20932081 } ) +
0 commit comments