impl Trait cannot work well with lifetime bounds #66551
Labels
A-impl-trait
Area: impl Trait. Universally / existentially quantified anonymous types with static dispatch.
A-lifetimes
Area: lifetime related
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Playground
The
self: &'s mut S<'t>
implies't: 's
, so the signature should be correct. But compiler still complain that't
is captured but does not appear inimpl
bounds.I checked the error description of
E0700
and triedimpl FnMut() + 's where 't: 's
andimpl FnMut() + 's + 't
, while it still fails.Note that when using
dyn Trait
aspub fn foo<'s>(&'s mut self) -> Box<dyn FnMut() + 's>
, it compiles.The text was updated successfully, but these errors were encountered: