Skip to content

Commit 9979500

Browse files
committed
---
yaml --- r: 209607 b: refs/heads/try c: c54f43a h: refs/heads/master i: 209605: bee38c1 209603: 6738247 209599: b2dfa58 v: v3
1 parent 4c301bd commit 9979500

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: dd5eed4b8136849537d1b2c8655bd29dc976d89a
5+
refs/heads/try: c54f43a5d18c89f65f22a179e8e6d05ce9c1d36c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/diagnostics.rs

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,26 @@ use Method::*;
217217
enum Method { GET, POST }
218218
"##,
219219

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+
220240
E0297: r##"
221241
Patterns used to bind names must be irrefutable. That is, they must guarantee
222242
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.
277297
Updates to the borrow checker in a future version of Rust may remove this
278298
restriction, but for now patterns must be rewritten without sub-bindings.
279299
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) => ...
283303
None => ...
284304
}
285305
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);
290310
...
291311
}
292312
None => ...
293313
}
294314
315+
The `op_string_ref` binding has type &Option<&String> in both cases.
316+
295317
See also https://github.com/rust-lang/rust/issues/14587
296318
"##,
297319

@@ -338,8 +360,6 @@ register_diagnostics! {
338360
E0264, // unknown external lang item
339361
E0265, // recursive constant
340362
E0266, // expected item
341-
E0267, // thing inside of a closure
342-
E0268, // thing outside of a loop
343363
E0269, // not all control paths return a value
344364
E0270, // computation may converge in a function marked as diverging
345365
E0271, // type mismatch resolving
@@ -357,7 +377,6 @@ register_diagnostics! {
357377
E0283, // cannot resolve type
358378
E0284, // cannot resolve type
359379
E0285, // overflow evaluation builtin bounds
360-
E0296, // malformed recursion limit attribute
361380
E0298, // mismatched types between arms
362381
E0299, // mismatched types between arms
363382
E0300, // unexpanded macro

0 commit comments

Comments
 (0)