Rollup merge of #153659 - oli-obk:brg_dc_merge_prelude, r=petrochenkov

Mark an unreachable match arm as such

Synchronize which elements have code paths and which are unreachable betwen def collector and build reduced graph.

Found while analyzing on how to best merge these two visitors in a reviewable way

r? @petrochenkov
This commit is contained in:
Jonathan Brouwer
2026-03-10 22:44:08 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
@@ -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);
+4 -1
View File
@@ -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);