diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-01 00:33:38 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:32:29 +0100 |
| commit | 996dc8d5c55a496bfbdc99a936fb6055bcbe2fcd (patch) | |
| tree | 2b92c207effac29986b51278ec11b7d5883cdf0e /compiler/rustc_ast_lowering/src | |
| parent | 786a80e9ea7af4909f67207c542eb02727f74756 (diff) | |
| download | rust-996dc8d5c55a496bfbdc99a936fb6055bcbe2fcd.tar.gz rust-996dc8d5c55a496bfbdc99a936fb6055bcbe2fcd.zip | |
Only store a LocalDefId in hir::ForeignItem.
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index b80b4a6b9b2..f88c73aee53 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -111,7 +111,7 @@ impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> { self.lctx.allocate_hir_id_counter(item.id); self.lctx.with_hir_id_owner(item.id, |lctx| { let hir_item = lctx.lower_foreign_item(item); - let id = hir::ForeignItemId { hir_id: hir_item.hir_id }; + let id = hir_item.foreign_item_id(); lctx.foreign_items.insert(id, hir_item); lctx.modules.get_mut(&lctx.current_module).unwrap().foreign_items.insert(id); }); @@ -711,7 +711,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn lower_foreign_item(&mut self, i: &ForeignItem) -> hir::ForeignItem<'hir> { let def_id = self.resolver.local_def_id(i.id); hir::ForeignItem { - hir_id: self.lower_node_id(i.id), + def_id, ident: i.ident, attrs: self.lower_attrs(&i.attrs), kind: match i.kind { @@ -746,7 +746,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn lower_foreign_item_ref(&mut self, i: &ForeignItem) -> hir::ForeignItemRef<'hir> { hir::ForeignItemRef { - id: hir::ForeignItemId { hir_id: self.lower_node_id(i.id) }, + id: hir::ForeignItemId { def_id: self.lower_node_id(i.id).expect_owner() }, ident: i.ident, span: i.span, vis: self.lower_visibility(&i.vis, Some(i.id)), |
