-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-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
Code
fn main() {
println!("", x.);
}
Current output
error: unexpected token: `<eof>`
--> src/main.rs:2:19
|
2 | println!("", x.);
| ^
Desired output
error: unexpected token: `)`
--> src/main.rs:2:19
|
2 | println!("", x.);
| ^
Rationale and extra context
While I fully understand, why it is saying <eof>
, I'm not sure if this can be improved, e.g. if the subparser says eof but the current parser has a character at that position, it could say which one it is.
Also the spike ^
points to the "eof" of the macro input, which can be improved I guess.
If we remove the !
, it is exactly what I'd like to see:
error: unexpected token: `)`
--> src/main.rs:2:19
|
2 | println("", x.);
| ^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-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.