Suggest code to use enum type in return type when accidentally using variant instance #57393
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
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.
When encountering an enum variant instance in a return type, make a better effort to suggest appropriate code.
Right now, if you accidentally write
Some(Span)
when you meantOption<Span>
, we mention the existence of the enum, but we don't suggest code:It'd be nice if we could suggest the appropriate code.
The text was updated successfully, but these errors were encountered: