Add a test for break

This commit is contained in:
varkor 2018-06-23 13:21:09 +01:00
parent 4efd5c75a8
commit dc7d77f88e
2 changed files with 9 additions and 1 deletions

View File

@ -12,4 +12,6 @@ fn main() {
|_: [_; continue]| {}; //~ ERROR: `continue` outside of loop
while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
}

View File

@ -10,7 +10,13 @@ error[E0590]: `break` or `continue` with no label in the condition of a `while`
LL | while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
error: aborting due to 2 previous errors
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
--> $DIR/closure-array-break-length.rs:16:19
|
LL | while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
| ^^^^^ unlabeled `break` in the condition of a `while` loop
error: aborting due to 3 previous errors
Some errors occurred: E0268, E0590.
For more information about an error, try `rustc --explain E0268`.