Remove trait_of_item query.
This commit is contained in:
parent
d7ea161b7e
commit
957548183d
10 changed files with 25 additions and 36 deletions
|
@ -9,7 +9,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
|
|||
associated_item_def_ids,
|
||||
associated_items,
|
||||
impl_item_implementor_ids,
|
||||
trait_of_item,
|
||||
..*providers
|
||||
};
|
||||
}
|
||||
|
@ -40,13 +39,6 @@ fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> FxHashMap<DefId
|
|||
.collect()
|
||||
}
|
||||
|
||||
/// If the given `DefId` describes an item belonging to a trait,
|
||||
/// returns the `DefId` of the trait that the trait item belongs to;
|
||||
/// otherwise, returns `None`.
|
||||
fn trait_of_item(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
|
||||
tcx.opt_associated_item(def_id).and_then(|associated_item| associated_item.trait_container(tcx))
|
||||
}
|
||||
|
||||
fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssocItem {
|
||||
let id = tcx.hir().local_def_id_to_hir_id(def_id.expect_local());
|
||||
let parent_def_id = tcx.hir().get_parent_item(id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue