Bad suggestions when trying to initialize an enum as a struct. #93322
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Occurs in nightly-2022-01-26
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2eec42713e64ef9243a12589aece967c
The output is a mess of false suggestions, I managed to hit an error that looked very similar to this while refactoring:
At a minimum we should detect that these suggestions are invalid and not suggest them:
However maybe we should instead suggest that the user try to properly use Foo as an enum?
The text was updated successfully, but these errors were encountered: