]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/impl_bounds_ok.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / generic-associated-types / impl_bounds_ok.rs
1 // check-pass
2
3 #![feature(associated_type_defaults)]
4
5 trait Foo {
6     type A<'a> where Self: 'a;
7     type B<'a, 'b> where 'a: 'b;
8     type C where Self: Clone;
9 }
10
11 #[derive(Clone)]
12 struct Fooy;
13
14 impl Foo for Fooy {
15     type A<'a> = (&'a ());
16     type B<'a: 'b, 'b> = (&'a(), &'b ());
17     type C = String;
18 }
19
20 #[derive(Clone)]
21 struct Fooer<T>(T);
22
23 impl<T> Foo for Fooer<T> {
24     type A<'x> = (&'x ()) where T: 'x;
25     type B<'u, 'v> = (&'v &'u ()) where 'u: 'v;
26     type C = String where Self: Clone + ToOwned;
27 }
28
29 fn main() {}