@@ -103,7 +103,7 @@ pub fn specialized_encode_alloc_id<
103
103
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
104
104
alloc_id : AllocId ,
105
105
) -> Result < ( ) , E :: Error > {
106
- let alloc_type: AllocType < ' tcx , & ' tcx Allocation > =
106
+ let alloc_type: AllocType < ' tcx > =
107
107
tcx. alloc_map . lock ( ) . get ( alloc_id) . expect ( "no value for AllocId" ) ;
108
108
match alloc_type {
109
109
AllocType :: Memory ( alloc) => {
@@ -291,22 +291,22 @@ impl fmt::Display for AllocId {
291
291
}
292
292
293
293
#[ derive( Debug , Clone , Eq , PartialEq , Hash , RustcDecodable , RustcEncodable ) ]
294
- pub enum AllocType < ' tcx , M > {
294
+ pub enum AllocType < ' tcx > {
295
295
/// The alloc id is used as a function pointer
296
296
Function ( Instance < ' tcx > ) ,
297
297
/// The alloc id points to a "lazy" static variable that did not get computed (yet).
298
298
/// This is also used to break the cycle in recursive statics.
299
299
Static ( DefId ) ,
300
300
/// The alloc id points to memory
301
- Memory ( M )
301
+ Memory ( & ' tcx Allocation ) ,
302
302
}
303
303
304
304
pub struct AllocMap < ' tcx > {
305
305
/// Lets you know what an AllocId refers to
306
- id_to_type : FxHashMap < AllocId , AllocType < ' tcx , & ' tcx Allocation > > ,
306
+ id_to_type : FxHashMap < AllocId , AllocType < ' tcx > > ,
307
307
308
308
/// Used to ensure that functions and statics only get one associated AllocId
309
- type_interner : FxHashMap < AllocType < ' tcx , & ' tcx Allocation > , AllocId > ,
309
+ type_interner : FxHashMap < AllocType < ' tcx > , AllocId > ,
310
310
311
311
/// The AllocId to assign to the next requested id.
312
312
/// Always incremented, never gets smaller.
@@ -336,7 +336,7 @@ impl<'tcx> AllocMap<'tcx> {
336
336
next
337
337
}
338
338
339
- fn intern ( & mut self , alloc_type : AllocType < ' tcx , & ' tcx Allocation > ) -> AllocId {
339
+ fn intern ( & mut self , alloc_type : AllocType < ' tcx > ) -> AllocId {
340
340
if let Some ( & alloc_id) = self . type_interner . get ( & alloc_type) {
341
341
return alloc_id;
342
342
}
@@ -354,7 +354,7 @@ impl<'tcx> AllocMap<'tcx> {
354
354
self . intern ( AllocType :: Function ( instance) )
355
355
}
356
356
357
- pub fn get ( & self , id : AllocId ) -> Option < AllocType < ' tcx , & ' tcx Allocation > > {
357
+ pub fn get ( & self , id : AllocId ) -> Option < AllocType < ' tcx > > {
358
358
self . id_to_type . get ( & id) . cloned ( )
359
359
}
360
360
0 commit comments