Skip to content

Suggest adding ' for incorrect loop labels #49240

Closed
@varkor

Description

@varkor
fn main() {
    label: loop {}
	//     ^^^^ error: expected identifier, found keyword `loop`
}

In situations like these, a more helpful suggestion would be to change label to 'label. I imagine this error could be special cased to look at the identifier and suggest something different for loop/while/for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions