]> git.proxmox.com Git - rustc.git/blame - src/test/ui/binding/pat-tuple-3.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / binding / pat-tuple-3.rs
CommitLineData
b7449926 1// run-pass
3157f602
XL
2fn tuple() {
3 let x = (1, 2, 3);
4 let branch = match x {
5 (1, 1, ..) => 0,
6 (1, 2, 3, ..) => 1,
7 (1, 2, ..) => 2,
8 _ => 3
9 };
10 assert_eq!(branch, 1);
11}
12
13fn tuple_struct() {
14 struct S(u8, u8, u8);
15
16 let x = S(1, 2, 3);
17 let branch = match x {
18 S(1, 1, ..) => 0,
19 S(1, 2, 3, ..) => 1,
20 S(1, 2, ..) => 2,
21 _ => 3
22 };
23 assert_eq!(branch, 1);
24}
25
26fn main() {
27 tuple();
28 tuple_struct();
29}