diff options
| author | bors <bors@rust-lang.org> | 2024-02-15 12:36:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-15 12:36:37 +0000 |
| commit | fa9f77ff35b4b63ed0cef9a9642c8f881b33f14f (patch) | |
| tree | 3960d1bfebde79b981e9ac87e62bbc65a1e792d9 /compiler/rustc_const_eval/src | |
| parent | 6a4222b5119bce8c24e74dd3ad44006ce0c803e6 (diff) | |
| parent | 3f27e4b3ea35c87c1e8a6b9b8a3c7e122f6299de (diff) | |
| download | rust-fa9f77ff35b4b63ed0cef9a9642c8f881b33f14f.tar.gz rust-fa9f77ff35b4b63ed0cef9a9642c8f881b33f14f.zip | |
Auto merge of #120931 - chenyukang:yukang-cleanup-hashmap, r=michaelwoerister
Clean up potential_query_instability with FxIndexMap and UnordMap From https://github.com/rust-lang/rust/pull/120485#issuecomment-1916437191 r? `@michaelwoerister`
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -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 2e642ac15b4..3b2208b8caa 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(), } } |
