clean up potential_query_instability with FxIndexMap and UnordMap
This commit is contained in:
parent
b381d3ab27
commit
3f27e4b3ea
30 changed files with 122 additions and 139 deletions
|
@ -4,6 +4,7 @@ use rustc_attr::InlineAttr;
|
|||
use rustc_data_structures::base_n;
|
||||
use rustc_data_structures::fingerprint::Fingerprint;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::fx::FxIndexMap;
|
||||
use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
||||
use rustc_hir::ItemId;
|
||||
|
@ -241,7 +242,7 @@ pub struct CodegenUnit<'tcx> {
|
|||
/// contain something unique to this crate (e.g., a module path)
|
||||
/// as well as the crate name and disambiguator.
|
||||
name: Symbol,
|
||||
items: FxHashMap<MonoItem<'tcx>, MonoItemData>,
|
||||
items: FxIndexMap<MonoItem<'tcx>, MonoItemData>,
|
||||
size_estimate: usize,
|
||||
primary: bool,
|
||||
/// True if this is CGU is used to hold code coverage information for dead code,
|
||||
|
@ -316,13 +317,11 @@ impl<'tcx> CodegenUnit<'tcx> {
|
|||
self.primary = true;
|
||||
}
|
||||
|
||||
/// The order of these items is non-determinstic.
|
||||
pub fn items(&self) -> &FxHashMap<MonoItem<'tcx>, MonoItemData> {
|
||||
pub fn items(&self) -> &FxIndexMap<MonoItem<'tcx>, MonoItemData> {
|
||||
&self.items
|
||||
}
|
||||
|
||||
/// The order of these items is non-determinstic.
|
||||
pub fn items_mut(&mut self) -> &mut FxHashMap<MonoItem<'tcx>, MonoItemData> {
|
||||
pub fn items_mut(&mut self) -> &mut FxIndexMap<MonoItem<'tcx>, MonoItemData> {
|
||||
&mut self.items
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue