Skip to content

Commit 21af89d

Browse files
committed
UsefulWithWitness always carries some witnesses
1 parent fe67196 commit 21af89d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/hair/pattern/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ fn check_not_useful(
492492
match is_useful(cx, matrix, &PatStack::from_pattern(&wild_pattern), ConstructWitness, hir_id) {
493493
NotUseful => Ok(()), // This is good, wildcard pattern isn't reachable.
494494
UsefulWithWitness(pats) => Err(if pats.is_empty() {
495-
vec![wild_pattern]
495+
bug!("Exhaustiveness check returned no witnesses")
496496
} else {
497497
pats.into_iter().map(|w| w.single_pattern()).collect()
498498
}),

0 commit comments

Comments
 (0)