RPIT with 'static bound captures lifetimes from generic arguments #106750
Labels
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
A-type-system
Area: Type system
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:
Both
bar
andbar2
should compile successfully, since both outputs have'static
bounds.Instead, this happened:
The version that calls
bar2
successfully compiles, whereas callingbar
results in the following error:Using a
TAIT
as the return type ofbar
seems to not capture any lifetimes fromT
.Meta
rustc --version --verbose
:This is also present on the latest stable version:
rustc 1.66.1
.The text was updated successfully, but these errors were encountered: