Update compiler/rustc_middle/src/hir/map/mod.rs
Co-authored-by: Michael Goulet <michael@errs.io>
This commit is contained in:
parent
7a19b17084
commit
c0c569f99d
1 changed files with 2 additions and 1 deletions
|
@ -598,7 +598,8 @@ impl<'hir> Map<'hir> {
|
|||
/// in the HIR which is recorded by the map and is an item, either an item
|
||||
/// in a module, trait, or impl.
|
||||
pub fn get_parent_item(self, hir_id: HirId) -> OwnerId {
|
||||
if hir_id.local_id.index() != 0 {
|
||||
if hir_id.local_id != ItemLocalId::ZERO {
|
||||
// If this is a child of a HIR owner, return the owner.
|
||||
hir_id.owner
|
||||
} else if let Some((def_id, _node)) = self.parent_owner_iter(hir_id).next() {
|
||||
def_id
|
||||
|
|
Loading…
Add table
Reference in a new issue