// Repro for . //@ edition: 2021 //@ revisions: assumptions no_assumptions //@[assumptions] compile-flags: -Zhigher-ranked-assumptions //@[assumptions] check-pass //@[no_assumptions] known-bug: #110338 use core::future::Future; use core::marker::PhantomData; use core::pin::Pin; use core::task::{Context, Poll}; async fn f() {} pub fn fail<'a>() -> Box + Send + 'a> { Box::new(async { new(|| async { f().await }).await }) } fn new(_a: A) -> F where A: Fn() -> B, { F { _i: PhantomData } } trait Stream { type Item; } struct T { _a: PhantomData, _b: PhantomData, } impl Stream for T where A: Fn() -> B, { type Item = B; } struct F where A: Fn() -> B, { _i: PhantomData< as Stream>::Item>, } impl Future for F where A: Fn() -> B, { type Output = (); fn poll(self: Pin<&mut Self>, _cx: &mut Context) -> Poll { unimplemented!() } } fn main() {}