-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #72235 - GuillaumeGomez:cleanup-E0590, r=Dylan-DPC
Clean up E0590 explanation r? @Dylan-DPC
- Loading branch information
Showing
1 changed file
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
`break` or `continue` must include a label when used in the condition of a | ||
`while` loop. | ||
`break` or `continue` keywords were used in a condition of a `while` loop | ||
without a label. | ||
|
||
Example of erroneous code: | ||
Erroneous code code: | ||
|
||
```compile_fail,E0590 | ||
while break {} | ||
``` | ||
|
||
`break` or `continue` must include a label when used in the condition of a | ||
`while` loop. | ||
|
||
To fix this, add a label specifying which loop is being broken out of: | ||
|
||
``` | ||
'foo: while break 'foo {} | ||
``` |