Confusing error message for missing associated type #66380
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have encountered associated types for the first time through a build error.
Associated types are used infrequently and other programmers will probably encounter the feature for the first time in a similar manner.
The error was particularly confusing because I thought that I was asked to provide a generic type to a type that was not generic. I was left rather puzzled.
It would be particularly helpful if in this instance the compiler could use information passed in from the single call point (i.e., from
main
) to suggest a fix (Feather<Error=String>
).The error message:
A short program to replicate the error message:
Ideally, the final suggestion would read:
The text was updated successfully, but these errors were encountered: