]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/pat-tuple-underfield.stderr
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / 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:44: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:9
12    |
13 LL | struct S(i32, f32);
14    | ------------------- tuple struct defined here
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:9
26    |
27 LL | struct S(i32, f32);
28    | ------------------- tuple struct defined here
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 defined here
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 1 field, but the corresponding tuple variant has 2 fields
61   --> $DIR/pat-tuple-underfield.rs:27:9
62    |
63 LL |     S(i32, f32),
64    |     ----------- tuple variant defined here
65 ...
66 LL |         E::S(x) => {}
67    |         ^^^^^^^ expected 2 fields, found 1
68    |
69 help: use `_` to explicitly ignore each field
70    |
71 LL |         E::S(x, _) => {}
72    |               ^^^
73
74 error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
75   --> $DIR/pat-tuple-underfield.rs:32:9
76    |
77 LL |     S(i32, f32),
78    |     ----------- tuple variant defined here
79 ...
80 LL |         E::S(_) => {}
81    |         ^^^^^^^ expected 2 fields, found 1
82    |
83 help: use `_` to explicitly ignore each field
84    |
85 LL |         E::S(_, _) => {}
86    |               ^^^
87 help: use `..` to ignore all fields
88    |
89 LL |         E::S(..) => {}
90    |              ^^
91
92 error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
93   --> $DIR/pat-tuple-underfield.rs:38:9
94    |
95 LL |     S(i32, f32),
96    |     ----------- tuple variant defined here
97 ...
98 LL |         E::S() => {}
99    |         ^^^^^^ expected 2 fields, found 0
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 2 fields, but the corresponding tuple struct has 4 fields
111   --> $DIR/pat-tuple-underfield.rs:50:9
112    |
113 LL | struct Point4(i32, i32, i32, i32);
114    | ---------------------------------- tuple struct defined here
115 ...
116 LL |         Point4(   a   ,     _    ) => {}
117    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 4 fields, found 2
118    |
119 help: use `_` to explicitly ignore each field
120    |
121 LL |         Point4(   a   ,     _    , _, _) => {}
122    |                                  ^^^^^^
123 help: use `..` to ignore the rest of the fields
124    |
125 LL |         Point4(   a, ..) => {}
126    |                    ^^^^
127
128 error: aborting due to 8 previous errors
129
130 Some errors have detailed explanations: E0023, E0532.
131 For more information about an error, try `rustc --explain E0023`.