2019-11-26 08:53:54 -06:00
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
2019-12-27 11:53:00 -06:00
|
|
|
// We wrap patterns in a tuple because top-level or-patterns were special-cased.
|
2019-11-26 08:53:54 -06:00
|
|
|
fn main() {
|
|
|
|
match (0u8, 0u8) {
|
2020-06-19 11:57:15 -05:00
|
|
|
//~^ ERROR non-exhaustive patterns: `(2_u8..=u8::MAX, _)`
|
2019-11-26 08:53:54 -06:00
|
|
|
(0 | 1, 2 | 3) => {}
|
|
|
|
}
|
|
|
|
match ((0u8,),) {
|
2020-06-19 11:57:15 -05:00
|
|
|
//~^ ERROR non-exhaustive patterns: `((4_u8..=u8::MAX))`
|
2019-12-27 06:03:03 -06:00
|
|
|
((0 | 1,) | (2 | 3,),) => {}
|
2019-11-26 08:53:54 -06:00
|
|
|
}
|
|
|
|
match (Some(0u8),) {
|
2020-06-19 11:57:15 -05:00
|
|
|
//~^ ERROR non-exhaustive patterns: `(Some(2_u8..=u8::MAX))`
|
2019-11-26 08:53:54 -06:00
|
|
|
(None | Some(0 | 1),) => {}
|
|
|
|
}
|
|
|
|
}
|