diff options
| author | bors <bors@rust-lang.org> | 2025-09-13 13:59:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-09-13 13:59:48 +0000 |
| commit | 637b50be01093962ac6f4432d6881ab41d6d90b4 (patch) | |
| tree | 7658ffd2f237a968ea16910cac2b1eeaacd6f804 /compiler/rustc_hir/src/intravisit.rs | |
| parent | b50f345a2f3f49764024cabc30ef99e15c0240f7 (diff) | |
| parent | b995a55cafcbcafec51aba6c567b32161fa9c2f1 (diff) | |
| download | rust-637b50be01093962ac6f4432d6881ab41d6d90b4.tar.gz rust-637b50be01093962ac6f4432d6881ab41d6d90b4.zip | |
Auto merge of #145186 - camsteffen:assoc-impl-kind, r=petrochenkov
Make `AssocItem` aware of its impl kind The general goal is to have fewer query dependencies by making `AssocItem` aware of its parent impl kind (inherent vs. trait) without having to query the parent def_kind. See individual commits.
Diffstat (limited to 'compiler/rustc_hir/src/intravisit.rs')
| -rw-r--r-- | compiler/rustc_hir/src/intravisit.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index 25a7ae239f3..eb682f32111 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -1257,18 +1257,21 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>( owner_id: _, ident, ref generics, + ref impl_kind, ref kind, - ref defaultness, span: _, - vis_span: _, has_delayed_lints: _, - trait_item_def_id: _, } = *impl_item; try_visit!(visitor.visit_ident(ident)); try_visit!(visitor.visit_generics(generics)); - try_visit!(visitor.visit_defaultness(defaultness)); try_visit!(visitor.visit_id(impl_item.hir_id())); + match impl_kind { + ImplItemImplKind::Inherent { vis_span: _ } => {} + ImplItemImplKind::Trait { defaultness, trait_item_def_id: _ } => { + try_visit!(visitor.visit_defaultness(defaultness)); + } + } match *kind { ImplItemKind::Const(ref ty, body) => { try_visit!(visitor.visit_ty_unambig(ty)); |
