Rustc complains about not being able to infer the wrong type parameter #105797
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: The compiler complain that the
W
parameter ofToFoo
couldn't be inferred.Instead, this happened: It instead complains about
T
.T
should be inferred from the argument being passed toto_foo
, but you get the same error message even if you explicitly specify it:It successfully compiles when the second type parameter (i.e.
W
) is explicitly specified.Meta
rustc --version --verbose
:Same thing happens on nightly.
The text was updated successfully, but these errors were encountered: