15
15
//! that contains allocations whose mutability we cannot identify.)
16
16
17
17
use super :: validity:: RefTracking ;
18
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
18
+ use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
19
19
use rustc_errors:: ErrorGuaranteed ;
20
20
use rustc_hir as hir;
21
21
use rustc_middle:: mir:: interpret:: InterpResult ;
@@ -37,7 +37,7 @@ pub trait CompileTimeMachine<'mir, 'tcx, T> = Machine<
37
37
ExtraFnVal = !,
38
38
FrameExtra = ( ) ,
39
39
AllocExtra = ( ) ,
40
- MemoryMap = FxHashMap < AllocId , ( MemoryKind < T > , Allocation ) > ,
40
+ MemoryMap = FxIndexMap < AllocId , ( MemoryKind < T > , Allocation ) > ,
41
41
> ;
42
42
43
43
struct 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
47
47
ref_tracking: & ' rt mut RefTracking < ( MPlaceTy < ' tcx > , InternMode ) > ,
48
48
/// A list of all encountered allocations. After type-based interning, we traverse this list to
49
49
/// 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 > ,
51
51
/// The root kind of the value that we're looking at. This field is never mutated for a
52
52
/// particular allocation. It is primarily used to make as many allocations as possible
53
53
/// read-only so LLVM can place them in const memory.
@@ -79,7 +79,7 @@ struct IsStaticOrFn;
79
79
/// to account for (e.g. for vtables).
80
80
fn intern_shallow < ' rt , ' mir , ' tcx , M : CompileTimeMachine < ' mir , ' tcx , const_eval:: MemoryKind > > (
81
81
ecx : & ' rt mut InterpCx < ' mir , ' tcx , M > ,
82
- leftover_allocations : & ' rt mut FxHashSet < AllocId > ,
82
+ leftover_allocations : & ' rt mut FxIndexSet < AllocId > ,
83
83
alloc_id : AllocId ,
84
84
mode : InternMode ,
85
85
ty : Option < Ty < ' tcx > > ,
@@ -355,7 +355,7 @@ pub fn intern_const_alloc_recursive<
355
355
// `leftover_allocations` collects *all* allocations we see, because some might not
356
356
// be available in a typed way. They get interned at the end.
357
357
let mut ref_tracking = RefTracking :: empty ( ) ;
358
- let leftover_allocations = & mut FxHashSet :: default ( ) ;
358
+ let leftover_allocations = & mut FxIndexSet :: default ( ) ;
359
359
360
360
// start with the outermost allocation
361
361
intern_shallow (
0 commit comments