Open Imberflur opened 2 years ago
@rustbot label requires-nightly, F-generic_associated_types, T-compiler
I think this is a known issue (iterator adapters don't play well with GATs atm), likely related to the leak check and universes work. Any fix here is probably going to be very involved.
GATs issue triage: not blocking. This needs some work with Polonius, I think. But not backwards-incompatible.
I'm trying to write a streaming/lending iterator trait using the nightly
generic_associated_types
feature (i.e. in the vein outlined here), in particular with afor_each
method:However, the lifetime bounds don't appear to be satisfied for calling the
for_each
method whenSelf
contains non'static
lifetimes:playground
I think I would expect
'a
be constrained to not outliveSelf
rather than requiringSelf
outlive any particular'a
. I could be missing something though.It appears to be triggered by the inclusion of the closure parameter with its impilcit HRTB So potentially this issue is related to https://github.com/rust-lang/rust/issues/88460
forum discussion
Meta
Version tested with on the playground: