hir: Remove hir::Map::{owner,expect_owner}

This commit is contained in:
Vadim Petrochenkov 2024-01-25 20:47:03 +03:00
parent 667d5d325f
commit db41f4aaa0
10 changed files with 11 additions and 19 deletions

View file

@ -148,12 +148,12 @@ impl<'tcx> TyCtxt<'tcx> {
}
#[inline]
fn expect_hir_owner_node(self, def_id: LocalDefId) -> OwnerNode<'tcx> {
pub fn expect_hir_owner_node(self, def_id: LocalDefId) -> OwnerNode<'tcx> {
self.expect_hir_owner_nodes(def_id).node()
}
#[inline]
fn hir_owner_node(self, owner_id: OwnerId) -> OwnerNode<'tcx> {
pub fn hir_owner_node(self, owner_id: OwnerId) -> OwnerNode<'tcx> {
self.hir_owner_nodes(owner_id).node()
}
@ -263,10 +263,6 @@ impl<'hir> Map<'hir> {
self.tcx.opt_hir_owner_node(id)?.generics()
}
pub fn owner(self, id: OwnerId) -> OwnerNode<'hir> {
self.tcx.hir_owner_node(id)
}
pub fn item(self, id: ItemId) -> &'hir Item<'hir> {
self.tcx.hir_owner_node(id.owner_id).expect_item()
}
@ -755,10 +751,6 @@ impl<'hir> Map<'hir> {
)
}
pub fn expect_owner(self, def_id: LocalDefId) -> OwnerNode<'hir> {
self.tcx.expect_hir_owner_node(def_id)
}
pub fn expect_item(self, id: LocalDefId) -> &'hir Item<'hir> {
match self.tcx.expect_hir_owner_node(id) {
OwnerNode::Item(item) => item,