]> git.lizzy.rs Git - rust.git/blob - tests/ui/duplicate/duplicate-type-parameter.rs
Rollup merge of #106958 - jyn514:labels, r=m-ou-se
[rust.git] / tests / ui / duplicate / duplicate-type-parameter.rs
1 type Foo<T,T> = Option<T>;
2 //~^ ERROR the name `T` is already used
3
4 struct Bar<T,T>(T);
5 //~^ ERROR the name `T` is already used
6
7 struct Baz<T,T> {
8 //~^ ERROR the name `T` is already used
9     x: T,
10 }
11
12 enum Boo<T,T> {
13 //~^ ERROR the name `T` is already used
14     A(T),
15     B,
16 }
17
18 fn quux<T,T>(x: T) {}
19 //~^ ERROR the name `T` is already used
20
21 trait Qux<T,T> {}
22 //~^ ERROR the name `T` is already used
23
24 impl<T,T> Qux<T,T> for Option<T> {}
25 //~^ ERROR the name `T` is already used
26 //~^^ ERROR the type parameter `T` is not constrained
27
28 fn main() {
29 }