]> git.lizzy.rs Git - rust.git/blob - src/test/ui/break-outside-loop.stderr
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / break-outside-loop.stderr
1 error[E0767]: use of unreachable label `'lab`
2   --> $DIR/break-outside-loop.rs:30:19
3    |
4 LL |     'lab: loop {
5    |     ---- unreachable label defined here
6 LL |         || {
7 LL |             break 'lab;
8    |                   ^^^^ unreachable label `'lab`
9    |
10    = note: labels are unreachable through functions, closures, async blocks and modules
11
12 error[E0268]: `break` outside of a loop
13   --> $DIR/break-outside-loop.rs:10:15
14    |
15 LL |     let pth = break;
16    |               ^^^^^ cannot `break` outside of a loop
17
18 error[E0268]: `continue` outside of a loop
19   --> $DIR/break-outside-loop.rs:11:17
20    |
21 LL |     if cond() { continue }
22    |                 ^^^^^^^^ cannot `continue` outside of a loop
23
24 error[E0267]: `break` inside of a closure
25   --> $DIR/break-outside-loop.rs:17:25
26    |
27 LL |         foo(|| {
28    |             -- enclosing closure
29 LL |             if cond() { break }
30    |                         ^^^^^ cannot `break` inside of a closure
31
32 error[E0267]: `continue` inside of a closure
33   --> $DIR/break-outside-loop.rs:18:25
34    |
35 LL |         foo(|| {
36    |             -- enclosing closure
37 LL |             if cond() { break }
38 LL |             if cond() { continue }
39    |                         ^^^^^^^^ cannot `continue` inside of a closure
40
41 error[E0268]: `break` outside of a loop
42   --> $DIR/break-outside-loop.rs:24:25
43    |
44 LL |     let unconstrained = break;
45    |                         ^^^^^ cannot `break` outside of a loop
46
47 error[E0267]: `break` inside of a closure
48   --> $DIR/break-outside-loop.rs:30:13
49    |
50 LL |         || {
51    |         -- enclosing closure
52 LL |             break 'lab;
53    |             ^^^^^^^^^^ cannot `break` inside of a closure
54
55 error: aborting due to 7 previous errors
56
57 Some errors have detailed explanations: E0267, E0268, E0767.
58 For more information about an error, try `rustc --explain E0267`.