@@ -16,14 +16,8 @@ note: trait defined here, with 1 generic parameter: `T`
16
16
LL | pub trait Trait<T> {
17
17
| ^^^^^ -
18
18
19
- error[E0207]: the type parameter `S` is not constrained by the impl trait, self type, or predicates
20
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:15:9
21
- |
22
- LL | impl<T, S> Trait<T, S> for () {}
23
- | ^ unconstrained type parameter
24
-
25
19
error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
26
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:20 :12
20
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:19 :12
27
21
|
28
22
LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
29
23
| ^^^^^ expected 1 generic argument
@@ -39,7 +33,7 @@ LL | fn func<T: Trait<u32, Assoc = String>>(t: T) -> impl Trait<(), i32> {
39
33
| +++++++
40
34
41
35
error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
42
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:20 :46
36
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:19 :46
43
37
|
44
38
LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
45
39
| ^^^^^ expected 1 generic argument
@@ -55,7 +49,7 @@ LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), Assoc = i32> {
55
49
| +++++++
56
50
57
51
error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
58
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:20 :46
52
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:19 :46
59
53
|
60
54
LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
61
55
| ^^^^^ expected 1 generic argument
@@ -71,14 +65,8 @@ help: replace the generic bound with the associated type
71
65
LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), Assoc = i32> {
72
66
| +++++++
73
67
74
- error[E0282]: type annotations needed
75
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:20:41
76
- |
77
- LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
78
- | ^^^^^^^^^^^^^^^^^^^ cannot infer type
79
-
80
68
error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
81
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:28 :18
69
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:26 :18
82
70
|
83
71
LL | struct Struct<T: Trait<u32, String>> {
84
72
| ^^^^^ expected 1 generic argument
@@ -94,7 +82,7 @@ LL | struct Struct<T: Trait<u32, Assoc = String>> {
94
82
| +++++++
95
83
96
84
error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
97
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:33 :23
85
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:31 :23
98
86
|
99
87
LL | trait AnotherTrait<T: Trait<T, i32>> {}
100
88
| ^^^^^ expected 1 generic argument
@@ -110,7 +98,7 @@ LL | trait AnotherTrait<T: Trait<T, Assoc = i32>> {}
110
98
| +++++++
111
99
112
100
error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
113
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:36 :9
101
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:34 :9
114
102
|
115
103
LL | impl<T: Trait<u32, String>> Struct<T> {}
116
104
| ^^^^^ expected 1 generic argument
@@ -126,20 +114,20 @@ LL | impl<T: Trait<u32, Assoc = String>> Struct<T> {}
126
114
| +++++++
127
115
128
116
error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
129
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:42 :58
117
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:40 :58
130
118
|
131
119
LL | impl<T: Trait<u32, Assoc=String>, U> YetAnotherTrait for Struct<T, U> {}
132
120
| ^^^^^^ - help: remove this generic argument
133
121
| |
134
122
| expected 1 generic argument
135
123
|
136
124
note: struct defined here, with 1 generic parameter: `T`
137
- --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:28 :8
125
+ --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:26 :8
138
126
|
139
127
LL | struct Struct<T: Trait<u32, String>> {
140
128
| ^^^^^^ -
141
129
142
- error: aborting due to 11 previous errors
130
+ error: aborting due to 9 previous errors
143
131
144
- Some errors have detailed explanations: E0107, E0207, E0282 .
132
+ Some errors have detailed explanations: E0107, E0207.
145
133
For more information about an error, try `rustc --explain E0107`.
0 commit comments