Closed
Description
Given the following code
let _ = ['1','2,'3'];
the current output is
error: lifetimes cannot start with a number
--> src/main.rs:2:18
|
2 | let _ = ['1','2,'3'];
| ^^
error: expected `while`, `for`, `loop` or `{` after a label
--> src/main.rs:2:20
|
2 | let _ = ['1','2,'3'];
| ^ expected `while`, `for`, `loop` or `{` after a label
It should instead recognize that a char literal was intended:
error: unterminated char literal
--> src/main.rs:2:18
|
2 | let _ = ['1','2,'3'];
| ^^
help: add a closing `'`
|
2 | let _ = ['1','2','3'];
| +
https://internals.rust-lang.org/t/error-message-for-vec-1-2-3/17309
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: An error or lint that needs small tweaks.Relevant to the compiler team, which will review and decide on the PR/issue.