Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering)

Part of https://github.com/rust-lang/compiler-team/issues/533
This commit is contained in:
Michael Woerister
2023-12-18 21:02:21 +01:00
parent 2a7634047a
commit 115885ba7e
12 changed files with 36 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
use crate::def::{CtorOf, DefKind, Res};
use crate::def_id::DefId;
use crate::def_id::{DefId, DefIdSet};
use crate::hir::{self, BindingAnnotation, ByRef, HirId, PatKind};
use rustc_data_structures::fx::FxHashSet;
use rustc_span::symbol::Ident;
use rustc_span::Span;
@@ -114,9 +113,9 @@ impl hir::Pat<'_> {
}
_ => true,
});
// We remove duplicates by inserting into a `FxHashSet` to avoid re-ordering
// We remove duplicates by inserting into a hash set to avoid re-ordering
// the bounds
let mut duplicates = FxHashSet::default();
let mut duplicates = DefIdSet::default();
variants.retain(|def_id| duplicates.insert(*def_id));
variants
}