]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/variance_constraints.rs
Rollup merge of #101741 - andrewpollack:add-needs-unwind-ui-tests, r=tmandry
[rust.git] / src / test / ui / generic-associated-types / variance_constraints.rs
1 // check-pass
2 // issue #69184
3
4 trait A {
5     type B<'a> where Self: 'a;
6
7     fn make_b<'a>(&'a self) -> Self::B<'a>;
8 }
9
10 struct S {}
11 impl A for S {
12     type B<'a> = &'a S;
13     fn make_b<'a>(&'a self) -> &'a Self {
14         self
15     }
16 }
17
18 enum E<'a> {
19     S(<S as A>::B<'a>),
20 }
21
22 fn main() {}