Mixed type parameter names shown if a type-def from a third party crate is used #81374
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see an error message pointing out that I need to specify the type of
t
because of the definition ofload()
is generic. This could either point att
saying that it needs to know the type of this variable or the generic parameter forload
saying that the user could specify that there as.load::<SomeTypeHere>()
.Instead, I got a "confusing" error message telling me something about two different type parameters (
T
andU
):The corresponding code in diesel roughly looks like:
It seems like rustc is missing up the generic type
T
from the typedef ofQueryResult
with the concrete generic typeU
from theload
implementation.Meta
rustc --version --verbose
:@rustbot modify labels: +D-confusing +A-diagnostics -C-Bug
The text was updated successfully, but these errors were encountered: