Skip to content

Commit ba7c770

Browse files
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
2 parents 09faa1c + 40ac87e commit ba7c770

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

compiler/rustc_resolve/src/build_reduced_graph.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,9 @@ impl<'a, 'ra, 'tcx> Visitor<'a> for BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
14741474
return;
14751475
}
14761476

1477-
AssocItemKind::DelegationMac(..) => bug!(),
1477+
AssocItemKind::DelegationMac(..) => {
1478+
span_bug!(item.span, "delegation mac should already have been removed")
1479+
}
14781480
};
14791481
let vis = self.resolve_visibility(&item.vis);
14801482
let feed = self.r.feed(item.id);

compiler/rustc_resolve/src/def_collector.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,12 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> {
358358
},
359359
),
360360
AssocItemKind::Type(box TyAlias { ident, .. }) => (*ident, DefKind::AssocTy),
361-
AssocItemKind::MacCall(..) | AssocItemKind::DelegationMac(..) => {
361+
AssocItemKind::MacCall(..) => {
362362
return self.visit_macro_invoc(i.id);
363363
}
364+
AssocItemKind::DelegationMac(..) => {
365+
span_bug!(i.span, "degation mac invoc should have already been handled")
366+
}
364367
};
365368

366369
let def = self.create_def(i.id, Some(ident.name), def_kind, i.span);

0 commit comments

Comments
 (0)