]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/pat-tuple-5.rs
Rollup merge of #93663 - sunfishcode:sunfishcode/as-raw-name, r=joshtriplett
[rust.git] / src / test / ui / binding / pat-tuple-5.rs
1 // run-pass
2 fn tuple() {
3     struct S;
4     struct Z;
5     struct W;
6     let x = (S, Z, W);
7     match x { (S, ..) => {} }
8     match x { (.., W) => {} }
9     match x { (S, .., W) => {} }
10     match x { (.., Z, _) => {} }
11 }
12
13 fn tuple_struct() {
14     struct SS(S, Z, W);
15
16     struct S;
17     struct Z;
18     struct W;
19     let x = SS(S, Z, W);
20     match x { SS(S, ..) => {} }
21     match x { SS(.., W) => {} }
22     match x { SS(S, .., W) => {} }
23     match x { SS(.., Z, _) => {} }
24 }
25
26 fn main() {
27     tuple();
28     tuple_struct();
29 }