]> git.lizzy.rs Git - rust.git/blob - src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs
Merge commit '15c8d31392b9fbab3b3368b67acc4bbe5983115a' into cranelift-rebase
[rust.git] / src / test / ui / or-patterns / exhaustiveness-non-exhaustive.rs
1 #![deny(unreachable_patterns)]
2
3 // We wrap patterns in a tuple because top-level or-patterns were special-cased.
4 fn main() {
5     match (0u8, 0u8) {
6         //~^ ERROR non-exhaustive patterns: `(2_u8..=u8::MAX, _)`
7         (0 | 1, 2 | 3) => {}
8     }
9     match ((0u8,),) {
10         //~^ ERROR non-exhaustive patterns: `((4_u8..=u8::MAX))`
11         ((0 | 1,) | (2 | 3,),) => {}
12     }
13     match (Some(0u8),) {
14         //~^ ERROR non-exhaustive patterns: `(Some(2_u8..=u8::MAX))`
15         (None | Some(0 | 1),) => {}
16     }
17 }