Use DefIdMap instead of FxHashMap for impl_item_implementor_ids query.
This commit is contained in:
parent
5983a3a99e
commit
5ff00f96e6
2 changed files with 3 additions and 4 deletions
|
@ -757,7 +757,7 @@ rustc_queries! {
|
||||||
///
|
///
|
||||||
/// The map returned for `tcx.impl_item_implementor_ids(impl_id)` would be
|
/// The map returned for `tcx.impl_item_implementor_ids(impl_id)` would be
|
||||||
///`{ trait_f: impl_f, trait_g: impl_g }`
|
///`{ trait_f: impl_f, trait_g: impl_g }`
|
||||||
query impl_item_implementor_ids(impl_id: DefId) -> &'tcx FxHashMap<DefId, DefId> {
|
query impl_item_implementor_ids(impl_id: DefId) -> &'tcx DefIdMap<DefId> {
|
||||||
arena_cache
|
arena_cache
|
||||||
desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
|
desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def::DefKind;
|
use rustc_hir::def::DefKind;
|
||||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId};
|
||||||
use rustc_hir::definitions::DefPathData;
|
use rustc_hir::definitions::DefPathData;
|
||||||
use rustc_hir::intravisit::{self, Visitor};
|
use rustc_hir::intravisit::{self, Visitor};
|
||||||
use rustc_middle::ty::{self, DefIdTree, TyCtxt};
|
use rustc_middle::ty::{self, DefIdTree, TyCtxt};
|
||||||
|
@ -40,7 +39,7 @@ fn associated_items(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssocItems {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> FxHashMap<DefId, DefId> {
|
fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> DefIdMap<DefId> {
|
||||||
tcx.associated_items(impl_id)
|
tcx.associated_items(impl_id)
|
||||||
.in_definition_order()
|
.in_definition_order()
|
||||||
.filter_map(|item| item.trait_item_def_id.map(|trait_item| (trait_item, item.def_id)))
|
.filter_map(|item| item.trait_item_def_id.map(|trait_item| (trait_item, item.def_id)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue