1 // edition:2018
2 
3 #![feature(generic_associated_types)]
4 #![feature(type_alias_impl_trait)]
5 
6 use std::future::Future;
7 
8 trait MakeFut {
9     type Fut<'a> where Self: 'a;
make_fut<'a>(&'a self) -> Self::Fut<'a>10     fn make_fut<'a>(&'a self) -> Self::Fut<'a>;
11 }
12 
13 impl MakeFut for &'_ mut () {
14     type Fut<'a> = impl Future<Output = ()>;
15     //~^ ERROR: the type `&mut ()` does not fulfill the required lifetime
16 
make_fut<'a>(&'a self) -> Self::Fut<'a>17     fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
18         async { () }
19     }
20 }
21 
main()22 fn main() {}
23