1
Fork 0

Remove a hir_* helper that was just forwarding to a query

This commit is contained in:
Oli Scherer 2025-04-01 09:48:17 +00:00
parent 7192a0643d
commit 062ef5365d
3 changed files with 2 additions and 6 deletions

View file

@ -367,10 +367,6 @@ impl<'tcx> TyCtxt<'tcx> {
}
}
pub fn hir_trait_impls(self, trait_did: DefId) -> &'tcx [LocalDefId] {
self.local_trait_impls(trait_did)
}
/// Gets the attributes on the crate. This is preferable to
/// invoking `krate.attrs` because it registers a tighter
/// dep-graph access.

View file

@ -235,7 +235,7 @@ pub(super) fn trait_impls_of_provider(tcx: TyCtxt<'_>, trait_id: DefId) -> Trait
}
}
for &impl_def_id in tcx.hir_trait_impls(trait_id) {
for &impl_def_id in tcx.local_trait_impls(trait_id) {
let impl_def_id = impl_def_id.to_def_id();
let impl_self_ty = tcx.type_of(impl_def_id).instantiate_identity();

View file

@ -365,7 +365,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
// obligation comes from the `impl`. Find that `impl` so that we can point
// at it in the suggestion.
let trait_did = trait_id.to_def_id();
tcx.hir_trait_impls(trait_did).iter().find_map(|&impl_did| {
tcx.local_trait_impls(trait_did).iter().find_map(|&impl_did| {
if let Node::Item(Item {
kind: ItemKind::Impl(hir::Impl { self_ty, .. }), ..
}) = tcx.hir_node_by_def_id(impl_did)