diff options
| author | yukang <moorekang@gmail.com> | 2024-02-11 19:50:50 +0800 |
|---|---|---|
| committer | yukang <moorekang@gmail.com> | 2024-02-14 18:36:37 +0800 |
| commit | 3f27e4b3ea35c87c1e8a6b9b8a3c7e122f6299de (patch) | |
| tree | ec5e00a1b03dfa35e7da6b6bff274552468206a2 /compiler/rustc_const_eval | |
| parent | b381d3ab27f788f990551100c4425bb782d26d76 (diff) | |
| download | rust-3f27e4b3ea35c87c1e8a6b9b8a3c7e122f6299de.tar.gz rust-3f27e4b3ea35c87c1e8a6b9b8a3c7e122f6299de.zip | |
clean up potential_query_instability with FxIndexMap and UnordMap
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 4acf4ed893c..a59429bfaac 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -13,7 +13,7 @@ use std::fmt; use std::ptr; use rustc_ast::Mutability; -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; +use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_middle::mir::display_allocation; use rustc_middle::ty::{self, Instance, ParamEnv, Ty, TyCtxt}; use rustc_target::abi::{Align, HasDataLayout, Size}; @@ -104,13 +104,13 @@ pub struct Memory<'mir, 'tcx, M: Machine<'mir, 'tcx>> { pub(super) alloc_map: M::MemoryMap, /// Map for "extra" function pointers. - extra_fn_ptr_map: FxHashMap<AllocId, M::ExtraFnVal>, + extra_fn_ptr_map: FxIndexMap<AllocId, M::ExtraFnVal>, /// To be able to compare pointers with null, and to check alignment for accesses /// to ZSTs (where pointers may dangle), we keep track of the size even for allocations /// that do not exist any more. // FIXME: this should not be public, but interning currently needs access to it - pub(super) dead_alloc_map: FxHashMap<AllocId, (Size, Align)>, + pub(super) dead_alloc_map: FxIndexMap<AllocId, (Size, Align)>, } /// A reference to some allocation that was already bounds-checked for the given region @@ -135,8 +135,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { pub fn new() -> Self { Memory { alloc_map: M::MemoryMap::default(), - extra_fn_ptr_map: FxHashMap::default(), - dead_alloc_map: FxHashMap::default(), + extra_fn_ptr_map: FxIndexMap::default(), + dead_alloc_map: FxIndexMap::default(), } } |
