]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
Tweak move error
[rust.git] / src / test / ui / pattern / usefulness / non-exhaustive-defined-here.stderr
1 error[E0004]: non-exhaustive patterns: `B` and `C` not covered
2   --> $DIR/non-exhaustive-defined-here.rs:32:11
3    |
4 LL | / enum E {
5 LL | |
6 LL | |
7 LL | |
8 ...  |
9 LL | |     B,
10    | |     - not covered
11 ...  |
12 LL | |     C
13    | |     - not covered
14 ...  |
15 LL | |
16 LL | | }
17    | |_- `E` defined here
18 ...
19 LL |       match e1 {
20    |             ^^ patterns `B` and `C` not covered
21    |
22    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
23    = note: the matched value is of type `E`
24
25 error[E0005]: refutable pattern in local binding: `B` and `C` not covered
26   --> $DIR/non-exhaustive-defined-here.rs:36:9
27    |
28 LL | / enum E {
29 LL | |
30 LL | |
31 LL | |
32 ...  |
33 LL | |     B,
34    | |     - not covered
35 ...  |
36 LL | |     C
37    | |     - not covered
38 ...  |
39 LL | |
40 LL | | }
41    | |_- `E` defined here
42 ...
43 LL |       let E::A = e;
44    |           ^^^^ patterns `B` and `C` not covered
45    |
46    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
47    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
48    = note: the matched value is of type `E`
49 help: you might want to use `if let` to ignore the variant that isn't matched
50    |
51 LL |     if let E::A = e { /* */ }
52    |     ~~~~~~~~~~~~~~~~~~~~~~~~~
53
54 error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered
55   --> $DIR/non-exhaustive-defined-here.rs:40:11
56    |
57 LL | / enum E {
58 LL | |
59 LL | |
60 LL | |
61 ...  |
62 LL | |     B,
63    | |     - not covered
64 ...  |
65 LL | |     C
66    | |     - not covered
67 ...  |
68 LL | |
69 LL | | }
70    | |_- `E` defined here
71 ...
72 LL |       match e {
73    |             ^ patterns `&B` and `&C` not covered
74    |
75    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
76    = note: the matched value is of type `&E`
77
78 error[E0005]: refutable pattern in local binding: `&B` and `&C` not covered
79   --> $DIR/non-exhaustive-defined-here.rs:44:9
80    |
81 LL | / enum E {
82 LL | |
83 LL | |
84 LL | |
85 ...  |
86 LL | |     B,
87    | |     - not covered
88 ...  |
89 LL | |     C
90    | |     - not covered
91 ...  |
92 LL | |
93 LL | | }
94    | |_- `E` defined here
95 ...
96 LL |       let E::A = e;
97    |           ^^^^ patterns `&B` and `&C` not covered
98    |
99    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
100    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
101    = note: the matched value is of type `&E`
102 help: you might want to use `if let` to ignore the variant that isn't matched
103    |
104 LL |     if let E::A = e { /* */ }
105    |     ~~~~~~~~~~~~~~~~~~~~~~~~~
106
107 error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
108   --> $DIR/non-exhaustive-defined-here.rs:48:11
109    |
110 LL | / enum E {
111 LL | |
112 LL | |
113 LL | |
114 ...  |
115 LL | |     B,
116    | |     - not covered
117 ...  |
118 LL | |     C
119    | |     - not covered
120 ...  |
121 LL | |
122 LL | | }
123    | |_- `E` defined here
124 ...
125 LL |       match e {
126    |             ^ patterns `&&mut &B` and `&&mut &C` not covered
127    |
128    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
129    = note: the matched value is of type `&&mut &E`
130
131 error[E0005]: refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered
132   --> $DIR/non-exhaustive-defined-here.rs:52:9
133    |
134 LL | / enum E {
135 LL | |
136 LL | |
137 LL | |
138 ...  |
139 LL | |     B,
140    | |     - not covered
141 ...  |
142 LL | |     C
143    | |     - not covered
144 ...  |
145 LL | |
146 LL | | }
147    | |_- `E` defined here
148 ...
149 LL |       let E::A = e;
150    |           ^^^^ patterns `&&mut &B` and `&&mut &C` not covered
151    |
152    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
153    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
154    = note: the matched value is of type `&&mut &E`
155 help: you might want to use `if let` to ignore the variant that isn't matched
156    |
157 LL |     if let E::A = e { /* */ }
158    |
159
160 error[E0004]: non-exhaustive patterns: `None` not covered
161   --> $DIR/non-exhaustive-defined-here.rs:65:11
162    |
163 LL | / enum Opt {
164 LL | |
165 LL | |
166 LL | |     Some(u8),
167 LL | |     None,
168    | |     ---- not covered
169 LL | |
170 LL | | }
171    | |_- `Opt` defined here
172 ...
173 LL |       match e {
174    |             ^ pattern `None` not covered
175    |
176    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
177    = note: the matched value is of type `Opt`
178
179 error[E0005]: refutable pattern in local binding: `None` not covered
180   --> $DIR/non-exhaustive-defined-here.rs:69:9
181    |
182 LL | / enum Opt {
183 LL | |
184 LL | |
185 LL | |     Some(u8),
186 LL | |     None,
187    | |     ---- not covered
188 LL | |
189 LL | | }
190    | |_- `Opt` defined here
191 ...
192 LL |       let Opt::Some(ref _x) = e;
193    |           ^^^^^^^^^^^^^^^^^ pattern `None` not covered
194    |
195    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
196    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
197    = note: the matched value is of type `Opt`
198 help: you might want to use `if let` to ignore the variant that isn't matched
199    |
200 LL |     if let Opt::Some(ref _x) = e { /* */ }
201    |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202
203 error: aborting due to 8 previous errors
204
205 Some errors have detailed explanations: E0004, E0005.
206 For more information about an error, try `rustc --explain E0004`.