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