Closed
Description
The compiler nicely reports when calling a function with too few arguments:
let ok = Ok();
leads to
error[[E0061]]: this enum variant takes 1 argument but 0 arguments were supplied
The compiler (on nightly) suggests:
help: provide the argument
|
6 | let ok = Ok({_});
| ~~~~~~~
This looks like a literal fix suggestion. However, the {_}
is probably intended as just a placeholder. Obviously inserting that directly yields another compiler error:
error: in expressions, `_` can only be used on the left-hand side of an assignment
I personally think the warning is already meaningful enough without the provide the argument
section (i.e. the way beta and stable handle this).
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: A structured suggestion resulting in incorrect code.Diagnostics: An error or lint that needs small tweaks.Relevant to the compiler team, which will review and decide on the PR/issue.