RPIT with 'static bound lifetime capture issue with generic parameter #125075
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.
I tried this code:
I expected to see this happen:
Successful compilation.
Instead, this happened:
The RPIT returned from
foo
has a'static
bound so it is unclear why there would be any complaints aboutcapturing a smaller lifetime (which still doesn't happen in this case as the RPIT returned from
foo
does not depend on_arg
at all).If the definition of
foo
above is changed to (by replacing the generic parameterA
with&str
):then the code compiles without a problem.
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: