Make iteration order of upstream_monomorphizations query stable
This commit is contained in:
parent
138cfab9f7
commit
0e934190fd
2 changed files with 6 additions and 6 deletions
|
@ -3,7 +3,7 @@ use crate::base::allocator_kind_for_codegen;
|
|||
use std::collections::hash_map::Entry::*;
|
||||
|
||||
use rustc_ast::expand::allocator::{ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::unord::UnordMap;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LOCAL_CRATE};
|
||||
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
|
@ -393,10 +393,10 @@ fn exported_symbols_provider_local(
|
|||
fn upstream_monomorphizations_provider(
|
||||
tcx: TyCtxt<'_>,
|
||||
(): (),
|
||||
) -> DefIdMap<FxHashMap<GenericArgsRef<'_>, CrateNum>> {
|
||||
) -> DefIdMap<UnordMap<GenericArgsRef<'_>, CrateNum>> {
|
||||
let cnums = tcx.crates(());
|
||||
|
||||
let mut instances: DefIdMap<FxHashMap<_, _>> = Default::default();
|
||||
let mut instances: DefIdMap<UnordMap<_, _>> = Default::default();
|
||||
|
||||
let drop_in_place_fn_def_id = tcx.lang_items().drop_in_place_fn();
|
||||
|
||||
|
@ -445,7 +445,7 @@ fn upstream_monomorphizations_provider(
|
|||
fn upstream_monomorphizations_for_provider(
|
||||
tcx: TyCtxt<'_>,
|
||||
def_id: DefId,
|
||||
) -> Option<&FxHashMap<GenericArgsRef<'_>, CrateNum>> {
|
||||
) -> Option<&UnordMap<GenericArgsRef<'_>, CrateNum>> {
|
||||
debug_assert!(!def_id.is_local());
|
||||
tcx.upstream_monomorphizations(()).get(&def_id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue