Skip to content

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

Closed

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;
}

Activity

  1. brson commented on Jan 18, 2017

    @brson
    Contributor

    Is this because of the type ascription parser? I recall there was another issue about making the stable parser not parse unstable things.

  2. added
    A-parserArea: The lexing & parsing of Rust source code to an AST
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    on Jan 18, 2017
  3. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 9, 2017
  4. Mark-Simulacrum commented on Jun 4, 2017

    @Mark-Simulacrum
    Member

    Closing in favor of #34255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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