rustc suggests invalid syntax to fix lifetime inferring error #62097
Labels
A-async-await
Area: Async & Await
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
AsyncAwait-Polish
Async-await issues that are part of the "polish" area
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
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.
I tried this code:
The code above does not compile, throwing an error with inferring lifetimes.
rustc
produces the following output:This suggestion
rustc
makes however, is invalid syntax. Trying to apply it's suggestion causes a syntax error as seen below.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: