@@ -217,6 +217,26 @@ use Method::*;
217
217
enum Method { GET, POST }
218
218
"## ,
219
219
220
+ E0267 : r##"
221
+ This error indicates the use of loop keyword (break or continue) inside a
222
+ closure but outside of any loop. Break and continue can be used as normal
223
+ inside closures as long as they are also contained within a loop. To halt the
224
+ execution of a closure you should instead use a return statement.
225
+ "## ,
226
+
227
+ E0268 : r##"
228
+ This error indicates the use of loop keyword (break or continue) outside of a
229
+ loop. Without a loop to break out of or continue in, no sensible action can be
230
+ taken.
231
+ "## ,
232
+
233
+ E0296 : r##"
234
+ This error indicates that the given recursion limit could not be parsed. Ensure
235
+ that the value provided is a positive integer between quotes, like so:
236
+
237
+ #![recursion_limit="1000"]
238
+ "## ,
239
+
220
240
E0297 : r##"
221
241
Patterns used to bind names must be irrefutable. That is, they must guarantee
222
242
that a name will be extracted in all cases. Instead of pattern matching the
@@ -277,21 +297,23 @@ In certain cases it is possible for sub-bindings to violate memory safety.
277
297
Updates to the borrow checker in a future version of Rust may remove this
278
298
restriction, but for now patterns must be rewritten without sub-bindings.
279
299
280
- // Code like this.. .
281
- match Some(5 ) {
282
- ref op_num @ Some(num ) => ...
300
+ // Before .
301
+ match Some("hi".to_string() ) {
302
+ ref op_string_ref @ Some(ref s ) => ...
283
303
None => ...
284
304
}
285
305
286
- // ... should be updated to code like this .
287
- match Some(5 ) {
288
- Some(num ) => {
289
- let op_num = &Some(num );
306
+ // After .
307
+ match Some("hi".to_string() ) {
308
+ Some(ref s ) => {
309
+ let op_string_ref = &Some(&s );
290
310
...
291
311
}
292
312
None => ...
293
313
}
294
314
315
+ The `op_string_ref` binding has type &Option<&String> in both cases.
316
+
295
317
See also https://github.com/rust-lang/rust/issues/14587
296
318
"## ,
297
319
@@ -338,8 +360,6 @@ register_diagnostics! {
338
360
E0264 , // unknown external lang item
339
361
E0265 , // recursive constant
340
362
E0266 , // expected item
341
- E0267 , // thing inside of a closure
342
- E0268 , // thing outside of a loop
343
363
E0269 , // not all control paths return a value
344
364
E0270 , // computation may converge in a function marked as diverging
345
365
E0271 , // type mismatch resolving
@@ -357,7 +377,6 @@ register_diagnostics! {
357
377
E0283 , // cannot resolve type
358
378
E0284 , // cannot resolve type
359
379
E0285 , // overflow evaluation builtin bounds
360
- E0296 , // malformed recursion limit attribute
361
380
E0298 , // mismatched types between arms
362
381
E0299 , // mismatched types between arms
363
382
E0300 , // unexpanded macro
0 commit comments