]> git.proxmox.com Git - rustc.git/blob - src/test/ui/generic-associated-types/impl_bounds_ok.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / impl_bounds_ok.rs
1 // check-pass
2
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
12 #[derive(Clone)]
13 struct Fooy;
14
15 impl Foo for Fooy {
16 type A<'a> = (&'a ());
17 type B<'a: 'b, 'b> = (&'a(), &'b ());
18 type C = String;
19 }
20
21 #[derive(Clone)]
22 struct Fooer<T>(T);
23
24 impl<T> Foo for Fooer<T> {
25 type A<'x> where T: 'x = (&'x ());
26 type B<'u, 'v> where 'u: 'v = (&'v &'u ());
27 type C where Self: Clone + ToOwned = String;
28 }
29
30 fn main() {}