- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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.
Description
Given the following code: link
fn main() {
    let 1x = 123;
}The current output is:
   Compiling playground v0.0.1 (/playground)
error: invalid suffix `x` for number literal
 --> src/main.rs:2:9
  |
2 |     let 1x = 123;
  |         ^^ invalid suffix `x`
  |
  = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
error: could not compile `playground` due to previous error
Ideally the output should inform the user that an identifier cannot start with a digit and not that the proceeding characters is an invalid suffix (since a literal in that place is invalid in the first place). Thanks.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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.