summaryrefslogtreecommitdiffstats
path: root/src/test/ui/duplicate/duplicate-type-parameter.rs
blob: 2751b3c8dc0ac2277f69d9e04c6db40c9354bb17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
type Foo<T,T> = Option<T>;
//~^ ERROR the name `T` is already used

struct Bar<T,T>(T);
//~^ ERROR the name `T` is already used

struct Baz<T,T> {
//~^ ERROR the name `T` is already used
    x: T,
}

enum Boo<T,T> {
//~^ ERROR the name `T` is already used
    A(T),
    B,
}

fn quux<T,T>(x: T) {}
//~^ ERROR the name `T` is already used

trait Qux<T,T> {}
//~^ ERROR the name `T` is already used

impl<T,T> Qux<T,T> for Option<T> {}
//~^ ERROR the name `T` is already used
//~^^ ERROR the type parameter `T` is not constrained

fn main() {
}