Clean up error messages regarding break/continue inside consts
This commit is contained in:
parent
b00050f4cf
commit
30fde04780
3 changed files with 43 additions and 48 deletions
|
|
@ -11,9 +11,7 @@
|
|||
fn main() {
|
||||
|_: [_; continue]| {}; //~ ERROR: `continue` outside of loop
|
||||
|
||||
while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
|
||||
//~^ ERROR: `continue` outside of loop
|
||||
while |_: [_; continue]| {} {} //~ ERROR: `continue` outside of loop
|
||||
|
||||
while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
|
||||
//~^ ERROR: `break` outside of loop
|
||||
while |_: [_; break]| {} {} //~ ERROR: `break` outside of loop
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,31 +4,18 @@ error[E0268]: `continue` outside of loop
|
|||
LL | |_: [_; continue]| {}; //~ ERROR: `continue` outside of loop
|
||||
| ^^^^^^^^ cannot break outside of a loop
|
||||
|
||||
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
|
||||
--> $DIR/closure-array-break-length.rs:14:19
|
||||
|
|
||||
LL | while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
|
||||
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
|
||||
|
||||
error[E0268]: `continue` outside of loop
|
||||
--> $DIR/closure-array-break-length.rs:14:19
|
||||
|
|
||||
LL | while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
|
||||
LL | while |_: [_; continue]| {} {} //~ ERROR: `continue` outside of loop
|
||||
| ^^^^^^^^ cannot break outside of a loop
|
||||
|
||||
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
|
||||
--> $DIR/closure-array-break-length.rs:17:19
|
||||
|
|
||||
LL | while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
|
||||
| ^^^^^ unlabeled `break` in the condition of a `while` loop
|
||||
|
||||
error[E0268]: `break` outside of loop
|
||||
--> $DIR/closure-array-break-length.rs:17:19
|
||||
--> $DIR/closure-array-break-length.rs:16:19
|
||||
|
|
||||
LL | while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
|
||||
LL | while |_: [_; break]| {} {} //~ ERROR: `break` outside of loop
|
||||
| ^^^^^ cannot break outside of a loop
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors occurred: E0268, E0590.
|
||||
For more information about an error, try `rustc --explain E0268`.
|
||||
For more information about this error, try `rustc --explain E0268`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue