// check-fail // edition:2021 // known-bug: #88908 // This should pass, but seems to run into a TAIT bug. #![feature(type_alias_impl_trait)] #![feature(generic_associated_types)] use std::future::Future; trait Stream { type Item; } struct Empty(T); impl Stream for Empty { type Item = (); } fn empty() -> Empty { todo!() } trait X { type LineStream<'a, Repr>: Stream where Self: 'a; type LineStreamFut<'a,Repr>: Future> where Self: 'a; fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream; type LineStreamFut<'a, Repr> = impl Future> ; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { async {empty()} } } fn main() {}