Skip to content

Commit

Permalink
UsefulWithWitness always carries some witnesses
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Dec 2, 2019
1 parent fe67196 commit 21af89d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/hair/pattern/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ fn check_not_useful(
match is_useful(cx, matrix, &PatStack::from_pattern(&wild_pattern), ConstructWitness, hir_id) {
NotUseful => Ok(()), // This is good, wildcard pattern isn't reachable.
UsefulWithWitness(pats) => Err(if pats.is_empty() {
vec![wild_pattern]
bug!("Exhaustiveness check returned no witnesses")
} else {
pats.into_iter().map(|w| w.single_pattern()).collect()
}),
Expand Down

0 comments on commit 21af89d

Please sign in to comment.