-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Implicit lifetime bound on impl type parameter not applied to associated function #83014
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-implied-boundsArea: Implied bounds / inferred outlives-boundsArea: Implied bounds / inferred outlives-boundsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-implied-boundsArea: Implied bounds / inferred outlives-boundsArea: Implied bounds / inferred outlives-boundsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
&selfparameter tocraft_reply(), it compiles. I cannot see what needs to be parameterised by the&selflifetime when it's not there, though.Other things that work:
impl<'m, S: Copy + 'm>(but I would have thought thatS: 'mwas implied by the reference toSrequiring lifetime'm)where S: 'mtocraft_reply()Updater::<'_, S>::craftinstead ofSelf::craftinside the function bodySome comments from the Discord (user
Yandros FR-ES):(Thread starts here.)