1 #![feature(generic_associated_types)]
2 #![feature(associated_type_defaults)]
3
4 // FIXME(#44265) add tests for type-generic and const-genertic associated types.
5
6 trait Foo {
7 type A<'a>;
8 type B<'a, 'b>;
9 type C;
10 }
11
12 struct Fooy;
13
14 impl Foo for Fooy {
15 type A = u32;
16 //~^ ERROR lifetime parameters or bounds on type `A` do not match the trait declaration
17 type B<'a, T> = Vec<T>;
18 //~^ ERROR type `B` has 1 type parameter but its trait declaration has 0 type parameters
19 type C<'a> = u32;
20 //~^ ERROR lifetime parameters or bounds on type `C` do not match the trait declaration
21 }
22
23 struct Fooer;
24
25 impl Foo for Fooer {
26 type A<T> = u32;
27 //~^ ERROR type `A` has 1 type parameter but its trait declaration has 0 type parameters
28 type B<'a> = u32;
29 //~^ ERROR lifetime parameters or bounds on type `B` do not match the trait declaration
30 type C<T> = T;
31 //~^ ERROR type `C` has 1 type parameter but its trait declaration has 0 type parameters
32 }
33
main()34 fn main() {}
35