Skip to content

Commit 40ac87e

Browse files
committed
Mark an unreachable match arm as such
Synchronize which elements have code paths and which are unreachable betwen def collector and build reduced graph
1 parent 98e7077 commit 40ac87e

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)