@@ -49,7 +49,6 @@ use crate::util::common::ErrorReported;
49
49
use crate :: util:: nodemap:: { DefIdMap , DefIdSet , ItemLocalMap , ItemLocalSet , NodeMap } ;
50
50
use crate :: util:: nodemap:: { FxHashMap , FxHashSet } ;
51
51
52
- use arena:: SyncDroplessArena ;
53
52
use errors:: DiagnosticBuilder ;
54
53
use rustc_data_structures:: profiling:: SelfProfilerRef ;
55
54
use rustc_data_structures:: sharded:: { IntoPointer , ShardedHashMap } ;
@@ -78,21 +77,11 @@ use syntax::expand::allocator::AllocatorKind;
78
77
use syntax:: source_map:: MultiSpan ;
79
78
use syntax:: symbol:: { kw, sym, Symbol } ;
80
79
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
-
91
80
type InternedSet < ' tcx , T > = ShardedHashMap < Interned < ' tcx , T > , ( ) > ;
92
81
93
82
pub struct CtxtInterners < ' tcx > {
94
83
/// The arena that types, regions, etc. are allocated from.
95
- arena : & ' tcx SyncDroplessArena ,
84
+ arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
96
85
97
86
/// Specifically use a speedy hash algorithm for these hash sets, since
98
87
/// they're accessed quite often.
@@ -112,7 +101,7 @@ pub struct CtxtInterners<'tcx> {
112
101
}
113
102
114
103
impl < ' tcx > CtxtInterners < ' tcx > {
115
- fn new ( arena : & ' tcx SyncDroplessArena ) -> CtxtInterners < ' tcx > {
104
+ fn new ( arena : & ' tcx WorkerLocal < Arena < ' tcx > > ) -> CtxtInterners < ' tcx > {
116
105
CtxtInterners {
117
106
arena,
118
107
type_ : Default :: default ( ) ,
@@ -1115,7 +1104,6 @@ impl<'tcx> TyCtxt<'tcx> {
1115
1104
lint_store : Lrc < lint:: LintStore > ,
1116
1105
local_providers : ty:: query:: Providers < ' tcx > ,
1117
1106
extern_providers : ty:: query:: Providers < ' tcx > ,
1118
- arenas : & ' tcx AllArenas ,
1119
1107
arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
1120
1108
resolutions : ty:: ResolverOutputs ,
1121
1109
hir : hir_map:: Map < ' tcx > ,
@@ -1126,7 +1114,7 @@ impl<'tcx> TyCtxt<'tcx> {
1126
1114
let data_layout = TargetDataLayout :: parse ( & s. target . target ) . unwrap_or_else ( |err| {
1127
1115
s. fatal ( & err) ;
1128
1116
} ) ;
1129
- let interners = CtxtInterners :: new ( & arenas . interner ) ;
1117
+ let interners = CtxtInterners :: new ( arena ) ;
1130
1118
let common_types = CommonTypes :: new ( & interners) ;
1131
1119
let common_lifetimes = CommonLifetimes :: new ( & interners) ;
1132
1120
let common_consts = CommonConsts :: new ( & interners, & common_types) ;
@@ -2084,7 +2072,7 @@ macro_rules! slice_interners {
2084
2072
$( impl <' tcx> TyCtxt <' tcx> {
2085
2073
pub fn $method( self , v: & [ $ty] ) -> & ' tcx List <$ty> {
2086
2074
self . interners. $field. intern_ref( v, || {
2087
- Interned ( List :: from_arena( & self . interners . arena, v) )
2075
+ Interned ( List :: from_arena( & * self . arena, v) )
2088
2076
} ) . 0
2089
2077
}
2090
2078
} ) +
0 commit comments