Skip to content

poor error message when colon is used instead of semicolon #39126

Closed
@tshepang

Description

@tshepang

I get this error:

error: expected type, found keyword `let`
 --> src/main.rs:3:5
  |
3 |     let two_squared = two * two;
  |     ^^^

That's with this code:

fn main() {
    let two = 2:
    let two_squared = two * two;
}

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