1
1
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::S`
2
- --> $DIR/pat-tuple-underfield.rs:42 :9
2
+ --> $DIR/pat-tuple-underfield.rs:44 :9
3
3
|
4
4
LL | S(i32, f32),
5
5
| ----------- `E::S` defined here
@@ -34,9 +34,13 @@ help: use `_` to explicitly ignore each field
34
34
|
35
35
LL | S(_, _) => {}
36
36
| ^^^
37
+ help: use `..` to ignore all fields
38
+ |
39
+ LL | S(..) => {}
40
+ | ^^
37
41
38
42
error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
39
- --> $DIR/pat-tuple-underfield.rs:19 :9
43
+ --> $DIR/pat-tuple-underfield.rs:20 :9
40
44
|
41
45
LL | struct S(i32, f32);
42
46
| ------------------- tuple struct defined here
@@ -54,7 +58,7 @@ LL | S(..) => {}
54
58
| ^^
55
59
56
60
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
57
- --> $DIR/pat-tuple-underfield.rs:26 :9
61
+ --> $DIR/pat-tuple-underfield.rs:27 :9
58
62
|
59
63
LL | S(i32, f32),
60
64
| ----------- tuple variant defined here
@@ -68,7 +72,7 @@ LL | E::S(x, _) => {}
68
72
| ^^^
69
73
70
74
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
71
- --> $DIR/pat-tuple-underfield.rs:31 :9
75
+ --> $DIR/pat-tuple-underfield.rs:32 :9
72
76
|
73
77
LL | S(i32, f32),
74
78
| ----------- tuple variant defined here
@@ -80,9 +84,13 @@ help: use `_` to explicitly ignore each field
80
84
|
81
85
LL | E::S(_, _) => {}
82
86
| ^^^
87
+ help: use `..` to ignore all fields
88
+ |
89
+ LL | E::S(..) => {}
90
+ | ^^
83
91
84
92
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
85
- --> $DIR/pat-tuple-underfield.rs:36 :9
93
+ --> $DIR/pat-tuple-underfield.rs:38 :9
86
94
|
87
95
LL | S(i32, f32),
88
96
| ----------- tuple variant defined here
@@ -100,7 +108,7 @@ LL | E::S(..) => {}
100
108
| ^^
101
109
102
110
error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
103
- --> $DIR/pat-tuple-underfield.rs:48 :9
111
+ --> $DIR/pat-tuple-underfield.rs:50 :9
104
112
|
105
113
LL | struct Point4(i32, i32, i32, i32);
106
114
| ---------------------------------- tuple struct defined here
0 commit comments