Merge visit_assoc_item

This commit is contained in:
Oli Scherer
2026-03-10 14:01:02 +00:00
committed by Oli Scherer
parent 3df953207d
commit b1ec02fc12
2 changed files with 5 additions and 3 deletions
@@ -1434,7 +1434,7 @@ pub(crate) fn brg_visit_block(&mut self, block: &'a Block) {
self.parent_scope.macro_rules = orig_current_macro_rules_scope;
}
fn visit_assoc_item(&mut self, item: &'a AssocItem, ctxt: AssocCtxt) {
pub(crate) fn brg_visit_assoc_item(&mut self, item: &'a AssocItem, ctxt: AssocCtxt) {
let (ident, ns) = match item.kind {
AssocItemKind::Const(box ConstItem { ident, .. })
| AssocItemKind::Fn(box Fn { ident, .. })
+4 -2
View File
@@ -380,7 +380,9 @@ fn visit_assoc_item(&mut self, i: &'a AssocItem, ctxt: visit::AssocCtxt) {
),
AssocItemKind::Type(box TyAlias { ident, .. }) => (*ident, DefKind::AssocTy),
AssocItemKind::MacCall(..) => {
return self.visit_macro_invoc(i.id);
self.visit_macro_invoc(i.id);
self.brg_visit_assoc_item(i, ctxt);
return;
}
AssocItemKind::DelegationMac(..) => {
span_bug!(i.span, "degation mac invoc should have already been handled")
@@ -388,7 +390,7 @@ fn visit_assoc_item(&mut self, i: &'a AssocItem, ctxt: visit::AssocCtxt) {
};
let def = self.create_def(i.id, Some(ident.name), def_kind, i.span);
self.with_parent(def, |this| visit::walk_assoc_item(this, i, ctxt));
self.with_parent(def, |this| this.brg_visit_assoc_item(i, ctxt));
}
fn visit_pat(&mut self, pat: &'a Pat) {