]>
Commit | Line | Data |
---|---|---|
c30ab7b3 SL |
1 | struct S; |
2 | ||
3 | trait Tr { | |
4 | fn f() { | |
5 | let s = Self {}; | |
e1599b0c | 6 | //~^ ERROR expected struct, variant or union type, found type parameter |
c30ab7b3 | 7 | let z = Self::<u8> {}; |
e1599b0c | 8 | //~^ ERROR expected struct, variant or union type, found type parameter |
923072b8 | 9 | //~| ERROR type arguments are not allowed on self type |
c30ab7b3 SL |
10 | match s { |
11 | Self { .. } => {} | |
e1599b0c | 12 | //~^ ERROR expected struct, variant or union type, found type parameter |
c30ab7b3 SL |
13 | } |
14 | } | |
15 | } | |
16 | ||
17 | impl Tr for S { | |
18 | fn f() { | |
19 | let s = Self {}; // OK | |
923072b8 | 20 | let z = Self::<u8> {}; //~ ERROR type arguments are not allowed on self type |
c30ab7b3 SL |
21 | match s { |
22 | Self { .. } => {} // OK | |
23 | } | |
24 | } | |
25 | } | |
26 | ||
27 | impl S { | |
28 | fn g() { | |
29 | let s = Self {}; // OK | |
923072b8 | 30 | let z = Self::<u8> {}; //~ ERROR type arguments are not allowed on self type |
c30ab7b3 SL |
31 | match s { |
32 | Self { .. } => {} // OK | |
33 | } | |
34 | } | |
35 | } | |
36 | ||
37 | fn main() {} |