-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Inherent async fn returning Self treats type's lifetime parameters as 'static #61949
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
rustc 1.37.0-nightly (2887008e0 2019-06-12)and playground's2019-06-17 b25ee644971a168287eePlayground
It works to either change the signature to take
bar: &'static i32, or to change the body of the fn to use a static borrow likebar: &5. So the compiler really does want the function to return aFoo<'static>, even thoughSelfis aFoo<'a>The workaround is to not use
Self:Mentoring notes: See notes here on Zulip.