]> git.proxmox.com Git - rustc.git/blob - src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs
New upstream version 1.53.0+dfsg1
[rustc.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 }