Raw ident suggestion should only trigger if the code is otherwise well-formed #66126
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Right now the raw ident suggestion when using a reserved keyword somewhere where it is not allowed is context free, leading to misleading output:
https://twitter.com/isislovecruft/status/1191768296590315520
The parser should perform some lookahead to see if it could actually continue parsing if a raw identifier had been supplied in its place and if so, only then suggest raw idents.
The text was updated successfully, but these errors were encountered: