-
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 lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-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
rust/tests/ui/closures/issue-84128.rs
Lines 7 to 16 in 0b90256
fn main() { | |
|| { | |
if false { | |
return Foo(0); | |
} | |
Foo(()) | |
//~^ ERROR mismatched types [E0308] | |
}; | |
} |
currently emits
rust/tests/ui/closures/issue-84128.stderr
Lines 1 to 13 in 0b90256
error[E0308]: mismatched types | |
--> $DIR/issue-84128.rs:13:13 | |
| | |
LL | Foo(()) | |
| --- ^^ expected integer, found `()` | |
| | | |
| arguments to this struct are incorrect | |
| | |
note: tuple struct defined here | |
--> $DIR/issue-84128.rs:5:8 | |
| | |
LL | struct Foo<T>(T); | |
| ^^^ |
It should include the source of the expectation (the return
statement earlier in the closure).
Noticed here https://github.com/rust-lang/rust/pull/106752/files#r1069781007
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-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.