]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/issue-12582.rs
Auto merge of #100845 - timvermeulen:iter_compare, r=scottmcm
[rust.git] / src / test / ui / pattern / issue-12582.rs
1 // run-pass
2
3 pub fn main() {
4     let x = 1;
5     let y = 2;
6
7     assert_eq!(3, match (x, y) {
8         (1, 1) => 1,
9         (2, 2) => 2,
10         (1..=2, 2) => 3,
11         _ => 4,
12     });
13
14     // nested tuple
15     assert_eq!(3, match ((x, y),) {
16         ((1, 1),) => 1,
17         ((2, 2),) => 2,
18         ((1..=2, 2),) => 3,
19         _ => 4,
20     });
21 }