about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/late
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-01-30 17:47:51 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2021-02-15 19:32:10 +0100
commitcebbba081e4609099df3921de8a1422b7ea52599 (patch)
tree96784e4ada9c7d62e8890ce8bac2d4f840eba6c4 /compiler/rustc_resolve/src/late
parentbd3cd5dbed5f56fb44a14a20dd2113e3049d2565 (diff)
downloadrust-cebbba081e4609099df3921de8a1422b7ea52599.tar.gz
rust-cebbba081e4609099df3921de8a1422b7ea52599.zip
Only store a LocalDefId in hir::Item.
Items are guaranteed to be HIR owner.
Diffstat (limited to 'compiler/rustc_resolve/src/late')
-rw-r--r--compiler/rustc_resolve/src/late/lifetimes.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs
index 5f09b643c50..fa8af36ec21 100644
--- a/compiler/rustc_resolve/src/late/lifetimes.rs
+++ b/compiler/rustc_resolve/src/late/lifetimes.rs
@@ -632,7 +632,8 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                                 let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
                                 // Ensure that the parent of the def is an item, not HRTB
                                 let parent_id = self.tcx.hir().get_parent_node(hir_id);
-                                let parent_item_id = hir::ItemId { id: parent_id };
+                                let parent_item_id =
+                                    hir::ItemId { def_id: parent_id.expect_owner() };
                                 let parent_impl_id = hir::ImplItemId { hir_id: parent_id };
                                 let parent_trait_id = hir::TraitItemId { hir_id: parent_id };
                                 let krate = self.tcx.hir().krate();
@@ -1256,7 +1257,7 @@ fn compute_object_lifetime_defaults(tcx: TyCtxt<'_>) -> HirIdMap<Vec<ObjectLifet
                     tcx.sess.span_err(item.span, &object_lifetime_default_reprs);
                 }
 
-                map.insert(item.hir_id, result);
+                map.insert(item.hir_id(), result);
             }
             _ => {}
         }