Closed
Description
The following code:
fn main() {
{
break ();
}
}
will output a diagnostic like this:
error[E0268]: `break` outside of a loop
--> src/main.rs:3:9
|
3 | break;
| ^^^^^ cannot `break` outside of a loop
No loops in scope here, but there is a possible change that could be made besides adding a loop – introducing labels and breaking out of the enclosing block.
This is a followup to #103981
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Relevant to the compiler team, which will review and decide on the PR/issue.