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