@@ -303,7 +303,7 @@ pub enum AllocKind<'tcx> {
303303
304304pub struct AllocMap < ' tcx > {
305305 /// Lets you know what an AllocId refers to
306- id_to_type : FxHashMap < AllocId , AllocKind < ' tcx > > ,
306+ id_to_kind : FxHashMap < AllocId , AllocKind < ' tcx > > ,
307307
308308 /// Used to ensure that statics only get one associated AllocId
309309 type_interner : FxHashMap < AllocKind < ' tcx > , AllocId > ,
@@ -316,7 +316,7 @@ pub struct AllocMap<'tcx> {
316316impl < ' tcx > AllocMap < ' tcx > {
317317 pub fn new ( ) -> Self {
318318 AllocMap {
319- id_to_type : Default :: default ( ) ,
319+ id_to_kind : Default :: default ( ) ,
320320 type_interner : Default :: default ( ) ,
321321 next_id : AllocId ( 0 ) ,
322322 }
@@ -345,7 +345,7 @@ impl<'tcx> AllocMap<'tcx> {
345345 }
346346 let id = self . reserve ( ) ;
347347 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 ( ) ) ;
349349 self . type_interner . insert ( alloc_kind, id) ;
350350 id
351351 }
@@ -356,7 +356,7 @@ impl<'tcx> AllocMap<'tcx> {
356356 /// `main as fn() == main as fn()` is false, while `let x = main as fn(); x == x` is true.
357357 pub fn create_fn_alloc ( & mut self , instance : Instance < ' tcx > ) -> AllocId {
358358 let id = self . reserve ( ) ;
359- self . id_to_type . insert ( id, AllocKind :: Function ( instance) ) ;
359+ self . id_to_kind . insert ( id, AllocKind :: Function ( instance) ) ;
360360 id
361361 }
362362
@@ -366,7 +366,7 @@ impl<'tcx> AllocMap<'tcx> {
366366 /// This function exists to allow const eval to detect the difference between evaluation-
367367 /// local dangling pointers and allocations in constants/statics.
368368 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 ( )
370370 }
371371
372372 /// Panics if the `AllocId` does not refer to an `Allocation`
@@ -397,15 +397,15 @@ impl<'tcx> AllocMap<'tcx> {
397397 /// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. Trying to
398398 /// call this function twice, even with the same `Allocation` will ICE the compiler.
399399 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) ) {
401401 bug ! ( "tried to set allocation id {}, but it was already existing as {:#?}" , id, old) ;
402402 }
403403 }
404404
405405 /// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. May be called
406406 /// twice for the same `(AllocId, Allocation)` pair.
407407 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) ) ;
409409 }
410410}
411411
0 commit comments