Suggest how to workaround E0212 #69000
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`
A-type-system
Area: Type system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
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.
It is not impossible for one to end up with a code that looks like this:
But fairly unintuitively the compiler rejects this code:
This can be made to work by specifying the lifetime for the associated type:
But it is fairly not obvious how to get there. We should suggest a similar transformation in the diagnostic.
cc @estebank
The text was updated successfully, but these errors were encountered: