diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index a280acc0d51d..80538aebf5f6 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -1474,7 +1474,9 @@ fn visit_assoc_item(&mut self, item: &'a AssocItem, ctxt: AssocCtxt) { return; } - AssocItemKind::DelegationMac(..) => bug!(), + AssocItemKind::DelegationMac(..) => { + span_bug!(item.span, "delegation mac should already have been removed") + } }; let vis = self.resolve_visibility(&item.vis); let feed = self.r.feed(item.id); diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 81820e049716..de36f01b6d0e 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -358,9 +358,12 @@ fn visit_assoc_item(&mut self, i: &'a AssocItem, ctxt: visit::AssocCtxt) { }, ), AssocItemKind::Type(box TyAlias { ident, .. }) => (*ident, DefKind::AssocTy), - AssocItemKind::MacCall(..) | AssocItemKind::DelegationMac(..) => { + AssocItemKind::MacCall(..) => { return self.visit_macro_invoc(i.id); } + AssocItemKind::DelegationMac(..) => { + span_bug!(i.span, "degation mac invoc should have already been handled") + } }; let def = self.create_def(i.id, Some(ident.name), def_kind, i.span);