summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/variance_constraints.rs
blob: 7d0f7638ac89dc008a5f43305440cff3c2299bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// check-pass
// issue #69184
#![feature(generic_associated_types)]

trait A {
    type B<'a> where Self: 'a;

    fn make_b<'a>(&'a self) -> Self::B<'a>;
}

struct S {}
impl A for S {
    type B<'a> = &'a S;
    fn make_b<'a>(&'a self) -> &'a Self {
        self
    }
}

enum E<'a> {
    S(<S as A>::B<'a>),
}

fn main() {}