1
Fork 0

clean up potential_query_instability with FxIndexMap and UnordMap

This commit is contained in:
yukang 2024-02-11 19:50:50 +08:00
parent b381d3ab27
commit 3f27e4b3ea
30 changed files with 122 additions and 139 deletions

View file

@ -15,7 +15,7 @@
//! crate as a kind of pass. This should eventually be factored away.
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_data_structures::unord::UnordMap;
use rustc_errors::{Applicability, DiagnosticBuilder, ErrorGuaranteed, StashKey};
use rustc_hir as hir;
@ -835,12 +835,12 @@ impl From<NestedSpan> for FieldDeclSpan {
struct FieldUniquenessCheckContext<'tcx> {
tcx: TyCtxt<'tcx>,
seen_fields: FxHashMap<Ident, FieldDeclSpan>,
seen_fields: FxIndexMap<Ident, FieldDeclSpan>,
}
impl<'tcx> FieldUniquenessCheckContext<'tcx> {
fn new(tcx: TyCtxt<'tcx>) -> Self {
Self { tcx, seen_fields: FxHashMap::default() }
Self { tcx, seen_fields: FxIndexMap::default() }
}
/// Check if a given field `ident` declared at `field_decl` has been declared elsewhere before.