fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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