// Repro for . //@ edition: 2021 //@ revisions: assumptions no_assumptions //@[assumptions] compile-flags: -Zhigher-ranked-assumptions //@[assumptions] check-pass //@[no_assumptions] known-bug: #110338 // Using `impl Future` instead of `async to ensure that the Future is Send. // // In the original code `a` would be `&[T]`. For more minimization I've removed the reference. fn foo(a: [(); 0]) -> impl std::future::Future + Send { async move { let iter = Adaptor::new(a.iter().map(|_: &()| {})); std::future::pending::<()>().await; drop(iter); } } struct Adaptor { iter: T, v: T::Item, } impl Adaptor { pub fn new(_: T) -> Self { Self { iter: todo!(), v: todo!() } } } fn main() {}