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