]>
Commit | Line | Data |
---|---|---|
dfeec247 XL |
1 | // check-pass |
2 | ||
dfeec247 XL |
3 | #![feature(generic_associated_types)] |
4 | #![feature(associated_type_defaults)] | |
5 | ||
6 | trait Foo { | |
7 | type A<'a> where Self: 'a; | |
8 | type B<'a, 'b> where 'a: 'b; | |
9 | type C where Self: Clone; | |
10 | } | |
11 | ||
29967ef6 | 12 | #[derive(Clone)] |
dfeec247 XL |
13 | struct Fooy; |
14 | ||
15 | impl Foo for Fooy { | |
16 | type A<'a> = (&'a ()); | |
29967ef6 | 17 | type B<'a: 'b, 'b> = (&'a(), &'b ()); |
dfeec247 XL |
18 | type C = String; |
19 | } | |
20 | ||
21 | #[derive(Clone)] | |
22 | struct Fooer<T>(T); | |
23 | ||
24 | impl<T> Foo for Fooer<T> { | |
ee023bcb FG |
25 | type A<'x> = (&'x ()) where T: 'x; |
26 | type B<'u, 'v> = (&'v &'u ()) where 'u: 'v; | |
27 | type C = String where Self: Clone + ToOwned; | |
dfeec247 XL |
28 | } |
29 | ||
30 | fn main() {} |