Confusing errors when using Self
variants with lifetimes
#69224
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Minimal example, imagine that we have the following type:
If the user returns
Self
variants, this fails:But the same code works when you change
Self
toMyCow
!The real error here is that
Self
really representsMyCow<'a>
and notMyCow<'_>
orMyCow<'static>
-, but the errors don't really relay this. Potentially linked issue: #30904 (has been fixed).The text was updated successfully, but these errors were encountered: