@@ -151,6 +151,26 @@ loop {
151
151
}
152
152
"## ,
153
153
154
+ E0267 : r##"
155
+ This error indicates the use of loop keyword (break or continue) inside a
156
+ closure but outside of any loop. Break and continue can be used as normal
157
+ inside closures as long as they are also contained within a loop. To halt the
158
+ execution of a closure you should instead use a return statement.
159
+ "## ,
160
+
161
+ E0268 : r##"
162
+ This error indicates the use of loop keyword (break or continue) outside of a
163
+ loop. Without a loop to break out of or continue in, no sensible action can be
164
+ taken.
165
+ "## ,
166
+
167
+ E0296 : r##"
168
+ This error indicates that the given recursion limit could not be parsed. Ensure
169
+ that the value provided is a positive integer between quotes, like so:
170
+
171
+ #![recursion_limit="1000"]
172
+ "## ,
173
+
154
174
E0297 : r##"
155
175
Patterns used to bind names must be irrefutable. That is, they must guarantee
156
176
that a name will be extracted in all cases. Instead of pattern matching the
@@ -211,21 +231,23 @@ In certain cases it is possible for sub-bindings to violate memory safety.
211
231
Updates to the borrow checker in a future version of Rust may remove this
212
232
restriction, but for now patterns must be rewritten without sub-bindings.
213
233
214
- // Code like this.. .
215
- match Some(5 ) {
216
- ref op_num @ Some(num ) => ...
234
+ // Before .
235
+ match Some("hi".to_string() ) {
236
+ ref op_string_ref @ Some(ref s ) => ...
217
237
None => ...
218
238
}
219
239
220
- // ... should be updated to code like this .
221
- match Some(5 ) {
222
- Some(num ) => {
223
- let op_num = &Some(num );
240
+ // After .
241
+ match Some("hi".to_string() ) {
242
+ Some(ref s ) => {
243
+ let op_string_ref = &Some(&s );
224
244
...
225
245
}
226
246
None => ...
227
247
}
228
248
249
+ The `op_string_ref` binding has type &Option<&String> in both cases.
250
+
229
251
See also https://github.com/rust-lang/rust/issues/14587
230
252
"##
231
253
@@ -266,8 +288,6 @@ register_diagnostics! {
266
288
E0264 , // unknown external lang item
267
289
E0265 , // recursive constant
268
290
E0266 , // expected item
269
- E0267 , // thing inside of a closure
270
- E0268 , // thing outside of a loop
271
291
E0269 , // not all control paths return a value
272
292
E0270 , // computation may converge in a function marked as diverging
273
293
E0271 , // type mismatch resolving
@@ -285,7 +305,6 @@ register_diagnostics! {
285
305
E0283 , // cannot resolve type
286
306
E0284 , // cannot resolve type
287
307
E0285 , // overflow evaluation builtin bounds
288
- E0296 , // malformed recursion limit attribute
289
308
E0298 , // mismatched types between arms
290
309
E0299 , // mismatched types between arms
291
310
E0300 , // unexpanded macro
0 commit comments