1515//! that contains allocations whose mutability we cannot identify.)
1616
1717use super :: validity:: RefTracking ;
18- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
18+ use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
1919use rustc_errors:: ErrorGuaranteed ;
2020use rustc_hir as hir;
2121use rustc_middle:: mir:: interpret:: InterpResult ;
@@ -37,7 +37,7 @@ pub trait CompileTimeMachine<'mir, 'tcx, T> = Machine<
3737 ExtraFnVal = !,
3838 FrameExtra = ( ) ,
3939 AllocExtra = ( ) ,
40- MemoryMap = FxHashMap < AllocId , ( MemoryKind < T > , Allocation ) > ,
40+ MemoryMap = FxIndexMap < AllocId , ( MemoryKind < T > , Allocation ) > ,
4141> ;
4242
4343struct InternVisitor < ' rt , ' mir , ' tcx , M : CompileTimeMachine < ' mir , ' tcx , const_eval:: MemoryKind > > {
@@ -47,7 +47,7 @@ struct InternVisitor<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, const_ev
4747 ref_tracking: & ' rt mut RefTracking < ( MPlaceTy < ' tcx > , InternMode ) > ,
4848 /// A list of all encountered allocations. After type-based interning, we traverse this list to
4949 /// also intern allocations that are only referenced by a raw pointer or inside a union.
50- leftover_allocations: & ' rt mut FxHashSet < AllocId > ,
50+ leftover_allocations: & ' rt mut FxIndexSet < AllocId > ,
5151 /// The root kind of the value that we're looking at. This field is never mutated for a
5252 /// particular allocation. It is primarily used to make as many allocations as possible
5353 /// read-only so LLVM can place them in const memory.
@@ -79,7 +79,7 @@ struct IsStaticOrFn;
7979/// to account for (e.g. for vtables).
8080fn intern_shallow < ' rt , ' mir , ' tcx , M : CompileTimeMachine < ' mir , ' tcx , const_eval:: MemoryKind > > (
8181 ecx : & ' rt mut InterpCx < ' mir , ' tcx , M > ,
82- leftover_allocations : & ' rt mut FxHashSet < AllocId > ,
82+ leftover_allocations : & ' rt mut FxIndexSet < AllocId > ,
8383 alloc_id : AllocId ,
8484 mode : InternMode ,
8585 ty : Option < Ty < ' tcx > > ,
@@ -355,7 +355,7 @@ pub fn intern_const_alloc_recursive<
355355 // `leftover_allocations` collects *all* allocations we see, because some might not
356356 // be available in a typed way. They get interned at the end.
357357 let mut ref_tracking = RefTracking :: empty ( ) ;
358- let leftover_allocations = & mut FxHashSet :: default ( ) ;
358+ let leftover_allocations = & mut FxIndexSet :: default ( ) ;
359359
360360 // start with the outermost allocation
361361 intern_shallow (
0 commit comments