Skip to content

Commit c0c569f

Browse files
Update compiler/rustc_middle/src/hir/map/mod.rs
Co-authored-by: Michael Goulet <[email protected]>
1 parent 7a19b17 commit c0c569f

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_middle/src/hir/map

1 file changed

+2
-1
lines changed

Diff for: compiler/rustc_middle/src/hir/map/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ impl<'hir> Map<'hir> {
598598
/// in the HIR which is recorded by the map and is an item, either an item
599599
/// in a module, trait, or impl.
600600
pub fn get_parent_item(self, hir_id: HirId) -> OwnerId {
601-
if hir_id.local_id.index() != 0 {
601+
if hir_id.local_id != ItemLocalId::ZERO {
602+
// If this is a child of a HIR owner, return the owner.
602603
hir_id.owner
603604
} else if let Some((def_id, _node)) = self.parent_owner_iter(hir_id).next() {
604605
def_id

0 commit comments

Comments
 (0)