Error diagnostic suggests syntactically invalid code #64388
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
For the following code (Playground link):
rustc
provides the following error and suggestion:But applying this suggestion results in a syntax error:
Using the Playground link, I reproduced this invalid suggestion on Rust 1.37.0 stable, 1.38.0-beta.2, and 1.39.0-nightly 2019-08-23.
The text was updated successfully, but these errors were encountered: