E0433 and E0599 should suggest correct type when it is known #137148
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-lack-of-suggestion
Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
Rust is usually helpful in telling the programmer what they probably meant, but not in this case. I was working in a file far away from an
enum
import and remembered the variant names but not theenum
name. Dummy names made the compiler give up with E0433, and existing-but-incorrect names made it give up with E0599. Diagnostics should have been able to tell what type was expected, and suggested it.Playground.
Other cases
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: