Parser finds nonexistent tokens after unclosed delimiters #86073
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Whenever there is an unclosed delimiter in the input, the parser tries to recover by inserting the expected closing delimiter somewhere. However, this leads to spurious error messages if another error occurs after recovering, e.g.:
or:
i.e. the error messages say that certain tokens were found that clearly aren't present in the input. I can understand why this happens, but I think it is confusing, and that artificially inserted tokens should not appear in error messages like this.
The text was updated successfully, but these errors were encountered: