11error[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
33 |
44LL | S(i32, f32),
55 | ----------- `E::S` defined here
@@ -8,7 +8,7 @@ LL | E::S => {}
88 | ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)`
99
1010error[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
1212 |
1313LL | struct S(i32, f32);
1414 | ------------------- tuple struct defined here
@@ -20,7 +20,7 @@ LL | S(x) => {}
2020 | expected 2 fields, found 1
2121
2222error[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
2424 |
2525LL | struct S(i32, f32);
2626 | ------------------- tuple struct defined here
@@ -32,7 +32,7 @@ LL | S(_) => {}
3232 | expected 2 fields, found 1
3333
3434error[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
3636 |
3737LL | struct S(i32, f32);
3838 | ------------------- tuple struct defined here
@@ -50,7 +50,7 @@ LL | S(..) => {}
5050 | ^^
5151
5252error[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
5454 |
5555LL | S(i32, f32),
5656 | ----------- tuple variant defined here
@@ -62,7 +62,7 @@ LL | E::S(x) => {}
6262 | expected 2 fields, found 1
6363
6464error[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
6666 |
6767LL | S(i32, f32),
6868 | ----------- tuple variant defined here
@@ -74,7 +74,7 @@ LL | E::S(_) => {}
7474 | expected 2 fields, found 1
7575
7676error[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
7878 |
7979LL | S(i32, f32),
8080 | ----------- tuple variant defined here
@@ -91,7 +91,25 @@ help: use `..` to ignore all fields
9191LL | E::S(..) => {}
9292 | ^^
9393
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
95113
96114Some errors have detailed explanations: E0023, E0532.
97115For more information about an error, try `rustc --explain E0023`.
0 commit comments