]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-90014.rs
Rollup merge of #94019 - hermitcore:target, r=Mark-Simulacrum
[rust.git] / src / test / ui / generic-associated-types / issue-90014.rs
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;
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
17     fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
18         async { () }
19     }
20 }
21
22 fn main() {}