-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-result-optionArea: Result and Option combinatorsArea: Result and Option combinatorsP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
pub struct Error {}
pub fn want_result() -> Option<(), Error> {
unimplemented!()
}
rust fails to compile this:
error[E0107]: wrong number of type arguments: expected 1, found 2
--> src/lib.rs:3:36
|
3 | pub fn want_result() -> Option<(), Error> {
| ^^^^^ unexpected type argument
error: aborting due to previous error
Since <x,y>
matches the Result
signature, it would be super neat if rustc could suggest something like Did you mean to use Result<(), Error> instead of Option<(), Error> here?
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-result-optionArea: Result and Option combinatorsArea: Result and Option combinatorsP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.