Misleading error message for code with associated types and lifetimes #74736
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code
currently produces the following error:
This is confusing because at a glance it would seem like the error is nonsensical. The associated type is i32, so how could they mismatch? I believe the real problem is that because there are no input references, no lifetime elision is taking place, meaning there is no '_ in scope for that function. The error message should probably be changed to something that actually mentions lifetimes (if I'm correct in my understanding of the real issue).
The text was updated successfully, but these errors were encountered: