Skip to content

Commit 5ff00f9

Browse files
Use DefIdMap instead of FxHashMap for impl_item_implementor_ids query.
1 parent 5983a3a commit 5ff00f9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ rustc_queries! {
757757
///
758758
/// The map returned for `tcx.impl_item_implementor_ids(impl_id)` would be
759759
///`{ trait_f: impl_f, trait_g: impl_g }`
760-
query impl_item_implementor_ids(impl_id: DefId) -> &'tcx FxHashMap<DefId, DefId> {
760+
query impl_item_implementor_ids(impl_id: DefId) -> &'tcx DefIdMap<DefId> {
761761
arena_cache
762762
desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
763763
}

compiler/rustc_ty_utils/src/assoc.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use rustc_data_structures::fx::FxHashMap;
21
use rustc_hir as hir;
32
use rustc_hir::def::DefKind;
4-
use rustc_hir::def_id::{DefId, LocalDefId};
3+
use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId};
54
use rustc_hir::definitions::DefPathData;
65
use rustc_hir::intravisit::{self, Visitor};
76
use rustc_middle::ty::{self, DefIdTree, TyCtxt};
@@ -40,7 +39,7 @@ fn associated_items(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssocItems {
4039
}
4140
}
4241

43-
fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> FxHashMap<DefId, DefId> {
42+
fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> DefIdMap<DefId> {
4443
tcx.associated_items(impl_id)
4544
.in_definition_order()
4645
.filter_map(|item| item.trait_item_def_id.map(|trait_item| (trait_item, item.def_id)))

0 commit comments

Comments
 (0)