rust/src/test/ui/break-outside-loop.stderr

59 lines
1.8 KiB
Plaintext
Raw Normal View History

error[E0767]: use of unreachable label `'lab`
--> $DIR/break-outside-loop.rs:30:19
|
LL | 'lab: loop {
| ---- unreachable label defined here
LL | || {
LL | break 'lab;
| ^^^^ unreachable label `'lab`
|
= note: labels are unreachable through functions, closures, async blocks and modules
error[E0268]: `break` outside of a loop
2018-12-25 09:56:47 -06:00
--> $DIR/break-outside-loop.rs:10:15
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let pth = break;
| ^^^^^ cannot `break` outside of a loop
2018-08-08 07:28:26 -05:00
error[E0268]: `continue` outside of a loop
2018-12-25 09:56:47 -06:00
--> $DIR/break-outside-loop.rs:11:17
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | if cond() { continue }
| ^^^^^^^^ cannot `continue` outside of a loop
2018-08-08 07:28:26 -05:00
error[E0267]: `break` inside of a closure
2018-12-25 09:56:47 -06:00
--> $DIR/break-outside-loop.rs:17:25
2018-08-08 07:28:26 -05:00
|
LL | foo(|| {
| -- enclosing closure
2019-03-09 06:03:44 -06:00
LL | if cond() { break }
| ^^^^^ cannot `break` inside of a closure
2018-08-08 07:28:26 -05:00
error[E0267]: `continue` inside of a closure
2018-12-25 09:56:47 -06:00
--> $DIR/break-outside-loop.rs:18:25
2018-08-08 07:28:26 -05:00
|
LL | foo(|| {
| -- enclosing closure
LL | if cond() { break }
2019-03-09 06:03:44 -06:00
LL | if cond() { continue }
| ^^^^^^^^ cannot `continue` inside of a closure
2018-08-08 07:28:26 -05:00
error[E0268]: `break` outside of a loop
2018-12-25 09:56:47 -06:00
--> $DIR/break-outside-loop.rs:24:25
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let unconstrained = break;
| ^^^^^ cannot `break` outside of a loop
2018-08-08 07:28:26 -05:00
error[E0267]: `break` inside of a closure
--> $DIR/break-outside-loop.rs:30:13
|
LL | || {
| -- enclosing closure
LL | break 'lab;
| ^^^^^^^^^^ cannot `break` inside of a closure
error: aborting due to 7 previous errors
2018-08-08 07:28:26 -05:00
Some errors have detailed explanations: E0267, E0268, E0767.
2018-08-08 07:28:26 -05:00
For more information about an error, try `rustc --explain E0267`.