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

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