lifetime bound when returning impl Trait is not considered #98719
Labels
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Lifetimes bounds added to returned
impl Trait
does not seem to be considered by the compiler.Example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=02f184ddb3ce9d04c049c93c9d8b25b5
I would expect the above example to compile:
wrap
is defined to return a'static
Future, so why is the compiler saying that it should have the same lifetime as&self
?The issue does not manifest when returning a concrete type like
MapErr
orBoxFuture<'static, Reply>
,@LucioFranco
The text was updated successfully, but these errors were encountered: