Closed
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.
Activity
chenyukang commentedon Nov 9, 2022
@rustbot claim
chenyukang commentedon Nov 12, 2022
Which one is a more proper?
chenyukang commentedon Nov 12, 2022
And, this actually is a valid code
We only report for identifer starts with digit and also contains some chars which is not digit, and it's not a valid number literal?
Rollup merge of rust-lang#104309 - chenyukang:yukang/fix-104088-ident…