UsefulWithWitness
always carries some witnesses
This commit is contained in:
parent
fe67196679
commit
21af89d773
1 changed files with 1 additions and 1 deletions
|
@ -492,7 +492,7 @@ fn check_not_useful(
|
||||||
match is_useful(cx, matrix, &PatStack::from_pattern(&wild_pattern), ConstructWitness, hir_id) {
|
match is_useful(cx, matrix, &PatStack::from_pattern(&wild_pattern), ConstructWitness, hir_id) {
|
||||||
NotUseful => Ok(()), // This is good, wildcard pattern isn't reachable.
|
NotUseful => Ok(()), // This is good, wildcard pattern isn't reachable.
|
||||||
UsefulWithWitness(pats) => Err(if pats.is_empty() {
|
UsefulWithWitness(pats) => Err(if pats.is_empty() {
|
||||||
vec![wild_pattern]
|
bug!("Exhaustiveness check returned no witnesses")
|
||||||
} else {
|
} else {
|
||||||
pats.into_iter().map(|w| w.single_pattern()).collect()
|
pats.into_iter().map(|w| w.single_pattern()).collect()
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue