about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/foreign_modules.rs
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2023-12-21 10:52:27 +0100
committerMichael Woerister <michaelwoerister@posteo>2024-01-04 13:32:42 +0100
commitdb132c575d1950c84d58009db922b6cbfe7a1918 (patch)
tree09050bcb961cc09fe29ae348dabdd003062c9e39 /compiler/rustc_lint/src/foreign_modules.rs
parent739e5ef49e28ea4b2ab20bd28251a2299bd6889c (diff)
downloadrust-db132c575d1950c84d58009db922b6cbfe7a1918.tar.gz
rust-db132c575d1950c84d58009db922b6cbfe7a1918.zip
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives.
Diffstat (limited to 'compiler/rustc_lint/src/foreign_modules.rs')
-rw-r--r--compiler/rustc_lint/src/foreign_modules.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_lint/src/foreign_modules.rs b/compiler/rustc_lint/src/foreign_modules.rs
index 31d9c0d33fe..ecb7a157f39 100644
--- a/compiler/rustc_lint/src/foreign_modules.rs
+++ b/compiler/rustc_lint/src/foreign_modules.rs
@@ -1,5 +1,5 @@
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::stack::ensure_sufficient_stack;
+use rustc_data_structures::unord::{UnordMap, UnordSet};
 use rustc_hir as hir;
 use rustc_hir::def::DefKind;
 use rustc_middle::query::Providers;
@@ -72,7 +72,7 @@ struct ClashingExternDeclarations {
     /// the symbol should be reported as a clashing declaration.
     // FIXME: Technically, we could just store a &'tcx str here without issue; however, the
     // `impl_lint_pass` macro doesn't currently support lints parametric over a lifetime.
-    seen_decls: FxHashMap<Symbol, hir::OwnerId>,
+    seen_decls: UnordMap<Symbol, hir::OwnerId>,
 }
 
 /// Differentiate between whether the name for an extern decl came from the link_name attribute or
@@ -96,7 +96,7 @@ impl SymbolName {
 
 impl ClashingExternDeclarations {
     pub(crate) fn new() -> Self {
-        ClashingExternDeclarations { seen_decls: FxHashMap::default() }
+        ClashingExternDeclarations { seen_decls: Default::default() }
     }
 
     /// Insert a new foreign item into the seen set. If a symbol with the same name already exists
@@ -209,12 +209,12 @@ fn structurally_same_type<'tcx>(
     b: Ty<'tcx>,
     ckind: types::CItemKind,
 ) -> bool {
-    let mut seen_types = FxHashSet::default();
+    let mut seen_types = UnordSet::default();
     structurally_same_type_impl(&mut seen_types, tcx, param_env, a, b, ckind)
 }
 
 fn structurally_same_type_impl<'tcx>(
-    seen_types: &mut FxHashSet<(Ty<'tcx>, Ty<'tcx>)>,
+    seen_types: &mut UnordSet<(Ty<'tcx>, Ty<'tcx>)>,
     tcx: TyCtxt<'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     a: Ty<'tcx>,