Closed
Description
I tried this code (playground):
match 'a' {
'\u{0}'..='\u{D7FF}' | '\u{E000}'..='\u{10_FFFF}' => {},
'\u{D7FF}'..='\u{E000}' => {}, // should be unreachable
}
The first pattern by itself is exhaustive, because it covers all the valid chars. The second pattern looks like it includes more chars than the first, but it doesn't, because those extra chars are all invalid. So the second pattern should be marked unreachable.
This fails on all rust versions on the playground, and I think it's been that way since we implemented exhaustive_integer_patterns
. I discovered it while working on the exhaustiveness algorithm.
@rustbot modify labels: +A-exhaustiveness-checking