Implicit lifetime bound on impl type parameter not applied to associated function #83014
Labels
A-implied-bounds
Area: Implied bounds / inferred outlives-bounds
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Consider this code:
It fails to compile on 1.50 and nightly 1.52.0-nightly (2021-03-10 f98721f) with:
If I add a
&self
parameter tocraft_reply()
, it compiles. I cannot see what needs to be parameterised by the&self
lifetime when it's not there, though.Other things that work:
impl<'m, S: Copy + 'm>
(but I would have thought thatS: 'm
was implied by the reference toS
requiring lifetime'm
)where S: 'm
tocraft_reply()
Updater::<'_, S>::craft
instead ofSelf::craft
inside the function bodySome comments from the Discord (user
Yandros FR-ES
):(Thread starts here.)
The text was updated successfully, but these errors were encountered: