Diagnostics: Suggest Unit Variant Enum in match #84700
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.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=5a6b1a3497842e4ddc883b2345febd8f
The current output is:
Ideally the output should look like:
I'd like it to say "try to use a
tupleunit variant like "FarmAnimal::Cow" instead".For example, here's what happens if you use Tuple syntax instead of Struct syntax:
So I'd like the new diagnostic to look something like:
The text was updated successfully, but these errors were encountered: