-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaC-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.
Description
Hello, I ran into a problem using <'_>
lifetime with async struct methods, here is the example:
struct Foo<'a> { swag: &'a i32 }
impl Foo<'_> {
async fn bar(&self) -> i32 {
1337
}
}
The error is:
error[E0496]: lifetime name
'_ shadows a lifetime name that is already in scope
Everything is fine if I use explicit lifetime like 'a
.
Version: 1.39 Nighly (2019-09-19 9b9d2af on playground)
ExpHP and olegnn
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaC-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.