about summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/rpitit.rs
blob: feeeb1461e8279cad6c3318803dcd492e7a945b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ 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.

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() {}