]> git.lizzy.rs Git - rust.git/blob - tests/ui/pattern/pat-tuple-underfield.stderr
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / pattern / pat-tuple-underfield.stderr
1 error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::S`
2   --> $DIR/pat-tuple-underfield.rs:56:9
3    |
4 LL |     S(i32, f32),
5    |     ----------- `E::S` defined here
6 ...
7 LL |         E::S => {}
8    |         ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)`
9
10 error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
11   --> $DIR/pat-tuple-underfield.rs:9:11
12    |
13 LL | struct S(i32, f32);
14    |          ---  --- tuple struct has 2 fields
15 ...
16 LL |         S(x) => {}
17    |           ^ expected 2 fields, found 1
18    |
19 help: use `_` to explicitly ignore each field
20    |
21 LL |         S(x, _) => {}
22    |            +++
23
24 error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
25   --> $DIR/pat-tuple-underfield.rs:14:11
26    |
27 LL | struct S(i32, f32);
28    |          ---  --- tuple struct has 2 fields
29 ...
30 LL |         S(_) => {}
31    |           ^ expected 2 fields, found 1
32    |
33 help: use `_` to explicitly ignore each field
34    |
35 LL |         S(_, _) => {}
36    |            +++
37 help: use `..` to ignore all fields
38    |
39 LL |         S(..) => {}
40    |           ~~
41
42 error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
43   --> $DIR/pat-tuple-underfield.rs:20:9
44    |
45 LL | struct S(i32, f32);
46    |          ---  --- tuple struct has 2 fields
47 ...
48 LL |         S() => {}
49    |         ^^^ expected 2 fields, found 0
50    |
51 help: use `_` to explicitly ignore each field
52    |
53 LL |         S(_, _) => {}
54    |           ++++
55 help: use `..` to ignore all fields
56    |
57 LL |         S(..) => {}
58    |           ++
59
60 error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
61   --> $DIR/pat-tuple-underfield.rs:26:9
62    |
63 LL | struct S(i32, f32);
64    |          ---  --- tuple struct has 2 fields
65 ...
66 LL |         S () => {}
67    |         ^^^^ expected 2 fields, found 0
68    |
69 help: use `_` to explicitly ignore each field
70    |
71 LL |         S (_, _) => {}
72    |            ++++
73 help: use `..` to ignore all fields
74    |
75 LL |         S (..) => {}
76    |            ++
77
78 error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
79   --> $DIR/pat-tuple-underfield.rs:33:14
80    |
81 LL |     S(i32, f32),
82    |       ---  --- tuple variant has 2 fields
83 ...
84 LL |         E::S(x) => {}
85    |              ^ expected 2 fields, found 1
86    |
87 help: use `_` to explicitly ignore each field
88    |
89 LL |         E::S(x, _) => {}
90    |               +++
91
92 error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
93   --> $DIR/pat-tuple-underfield.rs:38:14
94    |
95 LL |     S(i32, f32),
96    |       ---  --- tuple variant has 2 fields
97 ...
98 LL |         E::S(_) => {}
99    |              ^ expected 2 fields, found 1
100    |
101 help: use `_` to explicitly ignore each field
102    |
103 LL |         E::S(_, _) => {}
104    |               +++
105 help: use `..` to ignore all fields
106    |
107 LL |         E::S(..) => {}
108    |              ~~
109
110 error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
111   --> $DIR/pat-tuple-underfield.rs:44:9
112    |
113 LL |     S(i32, f32),
114    |       ---  --- tuple variant has 2 fields
115 ...
116 LL |         E::S() => {}
117    |         ^^^^^^ expected 2 fields, found 0
118    |
119 help: use `_` to explicitly ignore each field
120    |
121 LL |         E::S(_, _) => {}
122    |              ++++
123 help: use `..` to ignore all fields
124    |
125 LL |         E::S(..) => {}
126    |              ++
127
128 error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
129   --> $DIR/pat-tuple-underfield.rs:50:9
130    |
131 LL |     S(i32, f32),
132    |       ---  --- tuple variant has 2 fields
133 ...
134 LL |         E::S () => {}
135    |         ^^^^^^^ expected 2 fields, found 0
136    |
137 help: use `_` to explicitly ignore each field
138    |
139 LL |         E::S (_, _) => {}
140    |               ++++
141 help: use `..` to ignore all fields
142    |
143 LL |         E::S (..) => {}
144    |               ++
145
146 error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
147   --> $DIR/pat-tuple-underfield.rs:62:19
148    |
149 LL | struct Point4(i32, i32, i32, i32);
150    |               ---  ---  ---  --- tuple struct has 4 fields
151 ...
152 LL |         Point4(   a   ,     _    ) => {}
153    |                   ^         ^ expected 4 fields, found 2
154    |
155 help: use `_` to explicitly ignore each field
156    |
157 LL |         Point4(   a   ,     _    , _, _) => {}
158    |                                  ++++++
159 help: use `..` to ignore the rest of the fields
160    |
161 LL |         Point4(   a, ..) => {}
162    |                    ~~~~
163
164 error: aborting due to 10 previous errors
165
166 Some errors have detailed explanations: E0023, E0532.
167 For more information about an error, try `rustc --explain E0023`.