Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing parse error with let bindings #44767

Closed
Zoxc opened this issue Sep 22, 2017 · 0 comments · Fixed by #65640
Closed

Confusing parse error with let bindings #44767

Zoxc opened this issue Sep 22, 2017 · 0 comments · Fixed by #65640
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST. C-enhancement Category: An issue proposing an enhancement or a PR with one. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics

Comments

@Zoxc
Copy link
Contributor

Zoxc commented Sep 22, 2017

This code:

fn main() {
    let a = 3
}

gives the error:

error: expected one of `.`, `;`, `?`, or an operator, found `}`
 --> src/main.rs:3:1
  |
2 |     let a = 3
  |              - expected one of `.`, `;`, `?`, or an operator here
3 | }
  | ^ unexpected token

It would be nice if this would instead say that let is not an expression.

@Mark-Simulacrum Mark-Simulacrum added A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST. WG-diagnostics Working group: Diagnostics labels Sep 22, 2017
@TimNN TimNN added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Sep 24, 2017
@estebank estebank added D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 15, 2019
@bors bors closed this as completed in 2fe6f22 Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST. C-enhancement Category: An issue proposing an enhancement or a PR with one. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants