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