// check-pass // edition: 2021 #![feature(async_fn_in_trait)] #![feature(type_alias_impl_trait)] #![allow(incomplete_features)] use std::future::Future; trait MyTrait { type Fut<'a>: Future where Self: 'a; fn foo<'a>(&'a self) -> Self::Fut<'a>; } impl MyTrait for i32 { type Fut<'a> = impl Future + 'a where Self: 'a; fn foo<'a>(&'a self) -> Self::Fut<'a> { async { *self } } } fn main() {}