diff options
| author | bors <bors@rust-lang.org> | 2025-07-13 22:39:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-13 22:39:10 +0000 |
| commit | 9c3064e131f4939cc95a29bb11413c49bbda1491 (patch) | |
| tree | 8320ff7f32aa67eec55081c56987eb517095cb49 /compiler/rustc_ast_lowering/src/index.rs | |
| parent | e9182f195b8505c87c4bd055b9f6e114ccda0981 (diff) | |
| parent | 27127e342d28ebeb0734916ada6979b6938fb532 (diff) | |
| download | rust-9c3064e131f4939cc95a29bb11413c49bbda1491.tar.gz rust-9c3064e131f4939cc95a29bb11413c49bbda1491.zip | |
Auto merge of #143357 - cjgillot:no-assoc-item-kind, r=compiler-errors
Retire hir::*ItemRef. This information was kept for various places that iterate on HIR to know about trait-items and impl-items. This PR replaces them by uses of the `associated_items` query that contain pretty much the same information. This shortens many spans to just `def_span`, which can be easier to read.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/index.rs')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/index.rs | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/compiler/rustc_ast_lowering/src/index.rs b/compiler/rustc_ast_lowering/src/index.rs index 956cb580d10..1ef64f5a352 100644 --- a/compiler/rustc_ast_lowering/src/index.rs +++ b/compiler/rustc_ast_lowering/src/index.rs @@ -381,28 +381,16 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> { }) } - fn visit_trait_item_ref(&mut self, ii: &'hir TraitItemRef) { - // Do not visit the duplicate information in TraitItemRef. We want to - // map the actual nodes, not the duplicate ones in the *Ref. - let TraitItemRef { id, ident: _, kind: _, span: _ } = *ii; - - self.visit_nested_trait_item(id); + fn visit_trait_item_ref(&mut self, id: &'hir TraitItemId) { + self.visit_nested_trait_item(*id); } - fn visit_impl_item_ref(&mut self, ii: &'hir ImplItemRef) { - // Do not visit the duplicate information in ImplItemRef. We want to - // map the actual nodes, not the duplicate ones in the *Ref. - let ImplItemRef { id, ident: _, kind: _, span: _, trait_item_def_id: _ } = *ii; - - self.visit_nested_impl_item(id); + fn visit_impl_item_ref(&mut self, id: &'hir ImplItemId) { + self.visit_nested_impl_item(*id); } - fn visit_foreign_item_ref(&mut self, fi: &'hir ForeignItemRef) { - // Do not visit the duplicate information in ForeignItemRef. We want to - // map the actual nodes, not the duplicate ones in the *Ref. - let ForeignItemRef { id, ident: _, span: _ } = *fi; - - self.visit_nested_foreign_item(id); + fn visit_foreign_item_ref(&mut self, id: &'hir ForeignItemId) { + self.visit_nested_foreign_item(*id); } fn visit_where_predicate(&mut self, predicate: &'hir WherePredicate<'hir>) { |
