diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2023-12-21 11:13:03 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2024-01-04 13:37:21 +0100 |
| commit | 762e21f8c1664339cfd17eaabc0c229945c1be9f (patch) | |
| tree | 12f2eb13ebcd7bc7fb908a8d77b35f63ce071a0c /compiler/rustc_codegen_ssa/src/back | |
| parent | 02c7717ba6695f870fa3d9d306949efa178b1f1c (diff) | |
| download | rust-762e21f8c1664339cfd17eaabc0c229945c1be9f.tar.gz rust-762e21f8c1664339cfd17eaabc0c229945c1be9f.zip | |
Make iteration order of wasm_import_module_map query stable
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/symbol_export.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs index 0ff6a0c77d7..94841ab7b33 100644 --- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs @@ -656,7 +656,7 @@ fn maybe_emutls_symbol_name<'tcx>( } } -fn wasm_import_module_map(tcx: TyCtxt<'_>, cnum: CrateNum) -> FxHashMap<DefId, String> { +fn wasm_import_module_map(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap<String> { // Build up a map from DefId to a `NativeLib` structure, where // `NativeLib` internally contains information about // `#[link(wasm_import_module = "...")]` for example. @@ -665,9 +665,9 @@ fn wasm_import_module_map(tcx: TyCtxt<'_>, cnum: CrateNum) -> FxHashMap<DefId, S let def_id_to_native_lib = native_libs .iter() .filter_map(|lib| lib.foreign_module.map(|id| (id, lib))) - .collect::<FxHashMap<_, _>>(); + .collect::<DefIdMap<_>>(); - let mut ret = FxHashMap::default(); + let mut ret = DefIdMap::default(); for (def_id, lib) in tcx.foreign_modules(cnum).iter() { let module = def_id_to_native_lib.get(def_id).and_then(|s| s.wasm_import_module()); let Some(module) = module else { continue }; |
