]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/pat-tuple-underfield.rs
5 struct Point4(i32, i32, i32, i32);
10 //~^ ERROR this pattern has 1 field, but the corresponding tuple struct has 2 fields
11 //~| HELP use `_` to explicitly ignore each field
15 //~^ ERROR this pattern has 1 field, but the corresponding tuple struct has 2 fields
16 //~| HELP use `_` to explicitly ignore each field
17 //~| HELP use `..` to ignore all fields
21 //~^ ERROR this pattern has 0 fields, but the corresponding tuple struct has 2 fields
22 //~| HELP use `_` to explicitly ignore each field
23 //~| HELP use `..` to ignore all fields
25 // Test non-standard formatting
27 //~^ ERROR this pattern has 0 fields, but the corresponding tuple struct has 2 fields
28 //~| HELP use `_` to explicitly ignore each field
29 //~| HELP use `..` to ignore all fields
34 //~^ ERROR this pattern has 1 field, but the corresponding tuple variant has 2 fields
35 //~| HELP use `_` to explicitly ignore each field
39 //~^ ERROR this pattern has 1 field, but the corresponding tuple variant has 2 fields
40 //~| HELP use `_` to explicitly ignore each field
41 //~| HELP use `..` to ignore all fields
45 //~^ ERROR this pattern has 0 fields, but the corresponding tuple variant has 2 fields
46 //~| HELP use `_` to explicitly ignore each field
47 //~| HELP use `..` to ignore all fields
49 // Test non-standard formatting
51 //~^ ERROR this pattern has 0 fields, but the corresponding tuple variant has 2 fields
52 //~| HELP use `_` to explicitly ignore each field
53 //~| HELP use `..` to ignore all fields
57 //~^ ERROR expected unit struct, unit variant or constant, found tuple variant `E::S`
58 //~| HELP use the tuple variant pattern syntax instead
61 match Point4(0, 1, 2, 3) {
63 //~^ ERROR this pattern has 2 fields, but the corresponding tuple struct has 4 fields
64 //~| HELP use `_` to explicitly ignore each field
65 //~| HELP use `..` to ignore the rest of the fields