@@ -303,7 +303,7 @@ pub enum AllocKind<'tcx> {
303
303
304
304
pub struct AllocMap < ' tcx > {
305
305
/// Lets you know what an AllocId refers to
306
- id_to_type : FxHashMap < AllocId , AllocKind < ' tcx > > ,
306
+ id_to_kind : FxHashMap < AllocId , AllocKind < ' tcx > > ,
307
307
308
308
/// Used to ensure that statics only get one associated AllocId
309
309
type_interner : FxHashMap < AllocKind < ' tcx > , AllocId > ,
@@ -316,7 +316,7 @@ pub struct AllocMap<'tcx> {
316
316
impl < ' tcx > AllocMap < ' tcx > {
317
317
pub fn new ( ) -> Self {
318
318
AllocMap {
319
- id_to_type : Default :: default ( ) ,
319
+ id_to_kind : Default :: default ( ) ,
320
320
type_interner : Default :: default ( ) ,
321
321
next_id : AllocId ( 0 ) ,
322
322
}
@@ -345,7 +345,7 @@ impl<'tcx> AllocMap<'tcx> {
345
345
}
346
346
let id = self . reserve ( ) ;
347
347
debug ! ( "creating alloc_kind {:?} with id {}" , alloc_kind, id) ;
348
- self . id_to_type . insert ( id, alloc_kind. clone ( ) ) ;
348
+ self . id_to_kind . insert ( id, alloc_kind. clone ( ) ) ;
349
349
self . type_interner . insert ( alloc_kind, id) ;
350
350
id
351
351
}
@@ -356,7 +356,7 @@ impl<'tcx> AllocMap<'tcx> {
356
356
/// `main as fn() == main as fn()` is false, while `let x = main as fn(); x == x` is true.
357
357
pub fn create_fn_alloc ( & mut self , instance : Instance < ' tcx > ) -> AllocId {
358
358
let id = self . reserve ( ) ;
359
- self . id_to_type . insert ( id, AllocKind :: Function ( instance) ) ;
359
+ self . id_to_kind . insert ( id, AllocKind :: Function ( instance) ) ;
360
360
id
361
361
}
362
362
@@ -366,7 +366,7 @@ impl<'tcx> AllocMap<'tcx> {
366
366
/// This function exists to allow const eval to detect the difference between evaluation-
367
367
/// local dangling pointers and allocations in constants/statics.
368
368
pub fn get ( & self , id : AllocId ) -> Option < AllocKind < ' tcx > > {
369
- self . id_to_type . get ( & id) . cloned ( )
369
+ self . id_to_kind . get ( & id) . cloned ( )
370
370
}
371
371
372
372
/// Panics if the `AllocId` does not refer to an `Allocation`
@@ -397,15 +397,15 @@ impl<'tcx> AllocMap<'tcx> {
397
397
/// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. Trying to
398
398
/// call this function twice, even with the same `Allocation` will ICE the compiler.
399
399
pub fn set_id_memory ( & mut self , id : AllocId , mem : & ' tcx Allocation ) {
400
- if let Some ( old) = self . id_to_type . insert ( id, AllocKind :: Memory ( mem) ) {
400
+ if let Some ( old) = self . id_to_kind . insert ( id, AllocKind :: Memory ( mem) ) {
401
401
bug ! ( "tried to set allocation id {}, but it was already existing as {:#?}" , id, old) ;
402
402
}
403
403
}
404
404
405
405
/// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. May be called
406
406
/// twice for the same `(AllocId, Allocation)` pair.
407
407
pub fn set_id_same_memory ( & mut self , id : AllocId , mem : & ' tcx Allocation ) {
408
- self . id_to_type . insert_same ( id, AllocKind :: Memory ( mem) ) ;
408
+ self . id_to_kind . insert_same ( id, AllocKind :: Memory ( mem) ) ;
409
409
}
410
410
}
411
411
0 commit comments