summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/rpitit.rs
blob: 4eb053573e1f2b8c4dde67c5b086d0e43082b624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ known-bug: unknown

// RPITITs don't have variances in their GATs, so they always relate invariantly
// and act as if they capture all their args.
// To fix this soundly, we need to make sure that all the trait header args
// remain captured, since they affect trait selection.

#![feature(precise_capturing)]

trait Foo<'a> {
    fn hello() -> impl PartialEq + use<Self>;
}

fn test<'a, 'b, T: for<'r> Foo<'r>>() {
    PartialEq::eq(
        &<T as Foo<'a>>::hello(),
        &<T as Foo<'b>>::hello(),
    );
}

fn main() {}