Skip to content

Commit

Permalink
Add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Nov 21, 2019
1 parent 6e85f46 commit 0030a77
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/compile-fail/or-patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ fn main() {
(2 | 1, 4) => {} //~ ERROR unreachable pattern
_ => {}
}
match (Some(0u8),) {
(None | Some(1 | 2),) => {}
(Some(1),) => {} //~ ERROR unreachable pattern
(None,) => {} //~ ERROR unreachable pattern
(Some(_),) => {}
}
match ((0u8,),) {
((1 | 2,) | (3 | 4,),) => {},
((1..=4,),) => {}, //~ ERROR unreachable pattern
((_,),) => {},
}
}

0 comments on commit 0030a77

Please sign in to comment.