@@ -16,14 +16,8 @@ note: trait defined here, with 1 generic parameter: `T`
1616LL | pub trait Trait<T> {
1717 | ^^^^^ -
1818
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-
2519error[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
2721 |
2822LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
2923 | ^^^^^ expected 1 generic argument
@@ -39,7 +33,7 @@ LL | fn func<T: Trait<u32, Assoc = String>>(t: T) -> impl Trait<(), i32> {
3933 | +++++++
4034
4135error[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
4337 |
4438LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
4539 | ^^^^^ expected 1 generic argument
@@ -55,7 +49,7 @@ LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), Assoc = i32> {
5549 | +++++++
5650
5751error[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
5953 |
6054LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> {
6155 | ^^^^^ expected 1 generic argument
@@ -71,14 +65,8 @@ help: replace the generic bound with the associated type
7165LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), Assoc = i32> {
7266 | +++++++
7367
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-
8068error[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
8270 |
8371LL | struct Struct<T: Trait<u32, String>> {
8472 | ^^^^^ expected 1 generic argument
@@ -94,7 +82,7 @@ LL | struct Struct<T: Trait<u32, Assoc = String>> {
9482 | +++++++
9583
9684error[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
9886 |
9987LL | trait AnotherTrait<T: Trait<T, i32>> {}
10088 | ^^^^^ expected 1 generic argument
@@ -110,7 +98,7 @@ LL | trait AnotherTrait<T: Trait<T, Assoc = i32>> {}
11098 | +++++++
11199
112100error[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
114102 |
115103LL | impl<T: Trait<u32, String>> Struct<T> {}
116104 | ^^^^^ expected 1 generic argument
@@ -126,20 +114,20 @@ LL | impl<T: Trait<u32, Assoc = String>> Struct<T> {}
126114 | +++++++
127115
128116error[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
130118 |
131119LL | impl<T: Trait<u32, Assoc=String>, U> YetAnotherTrait for Struct<T, U> {}
132120 | ^^^^^^ - help: remove this generic argument
133121 | |
134122 | expected 1 generic argument
135123 |
136124note: 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
138126 |
139127LL | struct Struct<T: Trait<u32, String>> {
140128 | ^^^^^^ -
141129
142- error: aborting due to 11 previous errors
130+ error: aborting due to 9 previous errors
143131
144- Some errors have detailed explanations: E0107, E0207, E0282 .
132+ Some errors have detailed explanations: E0107, E0207.
145133For more information about an error, try `rustc --explain E0107`.
0 commit comments