Skip to content

Commit ae7fa30

Browse files
committed
Add tests based on issue #70372 comments
1 parent 5796e6e commit ae7fa30

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// check-pass
2+
3+
#![deny(unreachable_patterns)]
4+
5+
#![feature(or_patterns)]
6+
fn main() {
7+
match (3,42) {
8+
(a,_) | (_,a) if a > 10 => {println!("{}", a)}
9+
_ => ()
10+
}
11+
12+
match Some((3,42)) {
13+
Some((a, _)) | Some((_, a)) if a > 10 => {println!("{}", a)}
14+
_ => ()
15+
16+
}
17+
18+
match Some((3,42)) {
19+
Some((a, _) | (_, a)) if a > 10 => {println!("{}", a)}
20+
_ => ()
21+
}
22+
}

0 commit comments

Comments
 (0)