Add tests based on issue #70372 comments
This commit is contained in:
parent
5796e6e461
commit
ae7fa3042d
1 changed files with 22 additions and 0 deletions
|
@ -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)}
|
||||
_ => ()
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue