summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-65581.rs
blob: af65b79d3e838b58464797920d81d463decc68c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// check-pass

#![allow(dead_code)]

trait Trait1<T, U> {
    fn f1(self) -> U;
}

trait Trait2 {
    type T;
    type U: Trait2<T = Self::T>;
    fn f2(f: impl FnOnce(&Self::U));
}

fn f3<T: Trait2>() -> impl Trait1<T, T::T> {
    Struct1
}

struct Struct1;

impl<T: Trait2> Trait1<T, T::T> for Struct1 {
    fn f1(self) -> T::T {
        unimplemented!()
    }
}

fn f4<T: Trait2>() {
    T::f2(|_| {
        f3::<T::U>().f1();
    });
}

fn main() {}