diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index b145268796f2..be43bd9c24d3 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -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, .. }) diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 64dd0524fa28..3c1ffdd2650a 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -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) {