Skip to content

Commit 0030a77

Browse files
committed
Add some more tests
1 parent 6e85f46 commit 0030a77

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/compile-fail/or-patterns.rs

+11
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,15 @@ fn main() {
4242
(2 | 1, 4) => {} //~ ERROR unreachable pattern
4343
_ => {}
4444
}
45+
match (Some(0u8),) {
46+
(None | Some(1 | 2),) => {}
47+
(Some(1),) => {} //~ ERROR unreachable pattern
48+
(None,) => {} //~ ERROR unreachable pattern
49+
(Some(_),) => {}
50+
}
51+
match ((0u8,),) {
52+
((1 | 2,) | (3 | 4,),) => {},
53+
((1..=4,),) => {}, //~ ERROR unreachable pattern
54+
((_,),) => {},
55+
}
4556
}

0 commit comments

Comments
 (0)