Add a test for break
This commit is contained in:
parent
4efd5c75a8
commit
dc7d77f88e
@ -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
|
||||
}
|
||||
|
@ -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`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user