-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Parse error on labeled loop after break #86948
Copy link
Copy link
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
While playing with labels in Rust, I noticed that labeled loops can be used as expressions, but aren't parsed correctly after
break:Output:
This only happens when the label comes immediately after
break, so this does compile:Meta
rustc --version --verbose:(The same thing happened on all the platforms and versions I have tried.)