Skip to content

Commit

Permalink
Add tests based on issue rust-lang#70372 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AminArria committed Mar 26, 2020
1 parent 5796e6e commit ae7fa30
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// check-pass

#![deny(unreachable_patterns)]

#![feature(or_patterns)]
fn main() {
match (3,42) {
(a,_) | (_,a) if a > 10 => {println!("{}", a)}
_ => ()
}

match Some((3,42)) {
Some((a, _)) | Some((_, a)) if a > 10 => {println!("{}", a)}
_ => ()

}

match Some((3,42)) {
Some((a, _) | (_, a)) if a > 10 => {println!("{}", a)}
_ => ()
}
}

0 comments on commit ae7fa30

Please sign in to comment.