Anonymous lifetimes in impl trait are allowed in async fn, despite being an unstable feature #108468
Labels
A-async-await
Area: Async & Await
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
I tried this code (playground):
I expected to see this happen: an error because
&str
contains an anonymous lifetime, and is part of animpl Trait
type.Instead, this happened: Compiles successfully.
Removing
async
from the function definition gives the following error (on nightly to see the feature gate):This feature seems to have no documentation or tracking issue, only an unstable book entry. Given this, and the fact this behavior has been stable on async accidentally (AFAICT) for many releases now, maybe the best solution will be to just un-featuregate this functionality.
Meta
rustc --version --verbose
:@rustbot label: +A-impl-trait +T-compiler
The text was updated successfully, but these errors were encountered: