@@ -4,11 +4,19 @@ error[E0071]: expected struct, variant or union type, found type parameter `Self
4
4
LL | let s = Self {};
5
5
| ^^^^ not a struct
6
6
7
- error[E0109]: type arguments are not allowed for this type
7
+ error[E0109]: type arguments are not allowed on self type
8
8
--> $DIR/struct-path-self.rs:7:24
9
9
|
10
10
LL | let z = Self::<u8> {};
11
- | ^^ type argument not allowed
11
+ | ---- ^^ type argument not allowed
12
+ | |
13
+ | not allowed on this
14
+ |
15
+ help: the `Self` type doesn't accept type parameters
16
+ |
17
+ LL - let z = Self::<u8> {};
18
+ LL + let z = Self {};
19
+ |
12
20
13
21
error[E0071]: expected struct, variant or union type, found type parameter `Self`
14
22
--> $DIR/struct-path-self.rs:7:17
@@ -22,17 +30,49 @@ error[E0071]: expected struct, variant or union type, found type parameter `Self
22
30
LL | Self { .. } => {}
23
31
| ^^^^ not a struct
24
32
25
- error[E0109]: type arguments are not allowed for this type
33
+ error[E0109]: type arguments are not allowed on self type
26
34
--> $DIR/struct-path-self.rs:20:24
27
35
|
28
36
LL | let z = Self::<u8> {};
29
- | ^^ type argument not allowed
37
+ | ---- ^^ type argument not allowed
38
+ | |
39
+ | not allowed on this
40
+ |
41
+ note: `Self` is of type `S`
42
+ --> $DIR/struct-path-self.rs:1:8
43
+ |
44
+ LL | struct S;
45
+ | ^ `Self` corresponds to this type, which doesn't have generic parameters
46
+ ...
47
+ LL | impl Tr for S {
48
+ | ------------- `Self` is on type `S` in this `impl`
49
+ help: the `Self` type doesn't accept type parameters
50
+ |
51
+ LL - let z = Self::<u8> {};
52
+ LL + let z = Self {};
53
+ |
30
54
31
- error[E0109]: type arguments are not allowed for this type
55
+ error[E0109]: type arguments are not allowed on self type
32
56
--> $DIR/struct-path-self.rs:30:24
33
57
|
34
58
LL | let z = Self::<u8> {};
35
- | ^^ type argument not allowed
59
+ | ---- ^^ type argument not allowed
60
+ | |
61
+ | not allowed on this
62
+ |
63
+ note: `Self` is of type `S`
64
+ --> $DIR/struct-path-self.rs:1:8
65
+ |
66
+ LL | struct S;
67
+ | ^ `Self` corresponds to this type, which doesn't have generic parameters
68
+ ...
69
+ LL | impl S {
70
+ | ------ `Self` is on type `S` in this `impl`
71
+ help: the `Self` type doesn't accept type parameters
72
+ |
73
+ LL - let z = Self::<u8> {};
74
+ LL + let z = Self {};
75
+ |
36
76
37
77
error: aborting due to 6 previous errors
38
78
0 commit comments