summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/issue-90014.rs
blob: c4d762796e2deaa7fb845bc59858d5319bb0fc7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// edition:2018

#![feature(impl_trait_in_assoc_type)]

use std::future::Future;

trait MakeFut {
    type Fut<'a>
    where
        Self: 'a;
    fn make_fut<'a>(&'a self) -> Self::Fut<'a>;
}

impl MakeFut for &'_ mut () {
    type Fut<'a> = impl Future<Output = ()>;
    //~^ ERROR: the type `&mut ()` does not fulfill the required lifetime

    fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
        async { () }
    }
}

fn main() {}