Skip to content

Commit 762e21f

Browse files
Make iteration order of wasm_import_module_map query stable
1 parent 02c7717 commit 762e21f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ fn maybe_emutls_symbol_name<'tcx>(
656656
}
657657
}
658658

659-
fn wasm_import_module_map(tcx: TyCtxt<'_>, cnum: CrateNum) -> FxHashMap<DefId, String> {
659+
fn wasm_import_module_map(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap<String> {
660660
// Build up a map from DefId to a `NativeLib` structure, where
661661
// `NativeLib` internally contains information about
662662
// `#[link(wasm_import_module = "...")]` for example.
@@ -665,9 +665,9 @@ fn wasm_import_module_map(tcx: TyCtxt<'_>, cnum: CrateNum) -> FxHashMap<DefId, S
665665
let def_id_to_native_lib = native_libs
666666
.iter()
667667
.filter_map(|lib| lib.foreign_module.map(|id| (id, lib)))
668-
.collect::<FxHashMap<_, _>>();
668+
.collect::<DefIdMap<_>>();
669669

670-
let mut ret = FxHashMap::default();
670+
let mut ret = DefIdMap::default();
671671
for (def_id, lib) in tcx.foreign_modules(cnum).iter() {
672672
let module = def_id_to_native_lib.get(def_id).and_then(|s| s.wasm_import_module());
673673
let Some(module) = module else { continue };

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ rustc_queries! {
611611
desc { "erasing regions from `{}`", ty }
612612
}
613613

614-
query wasm_import_module_map(_: CrateNum) -> &'tcx FxHashMap<DefId, String> {
614+
query wasm_import_module_map(_: CrateNum) -> &'tcx DefIdMap<String> {
615615
arena_cache
616616
desc { "getting wasm import module map" }
617617
}

0 commit comments

Comments
 (0)