1
1
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::S`
2
- --> $DIR/pat-tuple-underfield.rs:41 :9
2
+ --> $DIR/pat-tuple-underfield.rs:42 :9
3
3
|
4
4
LL | S(i32, f32),
5
5
| ----------- `E::S` defined here
@@ -8,7 +8,7 @@ LL | E::S => {}
8
8
| ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)`
9
9
10
10
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
11
- --> $DIR/pat-tuple-underfield.rs:8 :9
11
+ --> $DIR/pat-tuple-underfield.rs:9 :9
12
12
|
13
13
LL | struct S(i32, f32);
14
14
| ------------------- tuple struct defined here
@@ -20,7 +20,7 @@ LL | S(x) => {}
20
20
| expected 2 fields, found 1
21
21
22
22
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
23
- --> $DIR/pat-tuple-underfield.rs:13 :9
23
+ --> $DIR/pat-tuple-underfield.rs:14 :9
24
24
|
25
25
LL | struct S(i32, f32);
26
26
| ------------------- tuple struct defined here
@@ -32,7 +32,7 @@ LL | S(_) => {}
32
32
| expected 2 fields, found 1
33
33
34
34
error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
35
- --> $DIR/pat-tuple-underfield.rs:18 :9
35
+ --> $DIR/pat-tuple-underfield.rs:19 :9
36
36
|
37
37
LL | struct S(i32, f32);
38
38
| ------------------- tuple struct defined here
@@ -50,7 +50,7 @@ LL | S(..) => {}
50
50
| ^^
51
51
52
52
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
53
- --> $DIR/pat-tuple-underfield.rs:25 :9
53
+ --> $DIR/pat-tuple-underfield.rs:26 :9
54
54
|
55
55
LL | S(i32, f32),
56
56
| ----------- tuple variant defined here
@@ -62,7 +62,7 @@ LL | E::S(x) => {}
62
62
| expected 2 fields, found 1
63
63
64
64
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
65
- --> $DIR/pat-tuple-underfield.rs:30 :9
65
+ --> $DIR/pat-tuple-underfield.rs:31 :9
66
66
|
67
67
LL | S(i32, f32),
68
68
| ----------- tuple variant defined here
@@ -74,7 +74,7 @@ LL | E::S(_) => {}
74
74
| expected 2 fields, found 1
75
75
76
76
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
77
- --> $DIR/pat-tuple-underfield.rs:35 :9
77
+ --> $DIR/pat-tuple-underfield.rs:36 :9
78
78
|
79
79
LL | S(i32, f32),
80
80
| ----------- tuple variant defined here
@@ -91,7 +91,25 @@ help: use `..` to ignore all fields
91
91
LL | E::S(..) => {}
92
92
| ^^
93
93
94
- error: aborting due to 7 previous errors
94
+ error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
95
+ --> $DIR/pat-tuple-underfield.rs:48:9
96
+ |
97
+ LL | struct Point4(i32, i32, i32, i32);
98
+ | ---------------------------------- tuple struct defined here
99
+ ...
100
+ LL | Point4( a , _ ) => {}
101
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 4 fields, found 2
102
+ |
103
+ help: use `_` to explicitly ignore each field
104
+ |
105
+ LL | Point4( a , _ , _, _) => {}
106
+ | ^^^^^^
107
+ help: use `..` to ignore the rest of the fields
108
+ |
109
+ LL | Point4( a , _ , ..) => {}
110
+ | ^^^^
111
+
112
+ error: aborting due to 8 previous errors
95
113
96
114
Some errors have detailed explanations: E0023, E0532.
97
115
For more information about an error, try `rustc --explain E0023`.
0 commit comments