-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language team
Description
Location
Summary
The reference unambiguously states that "A continue expression is only permitted in the body of a loop.", but this is demonstrably not true for continue 'label
expressions.
The following compiles and runs an infinite loop. A warning mentions the body being unreachable, but otherwise the behavior is as one would expect:
'a: while continue 'a {}
Meanwhile, the following does not compile:
while { continue; true } {}
In the second example, an error is generated:
error[E0590]:
break
orcontinue
with no label in the condition of awhile
loop
Furthermore, rustc --explain E0590
demonstrates label usage with a break
expression:
'foo: while break 'foo {}
Unless I have misunderstood something, there seems to be conflicting information between the reference and the actual behavior of the compiler.
Edit: grammar.
zopsicle
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language team