Skip to content

Commit 6d19ac3

Browse files
Update Tests
1 parent 7ebd2bd commit 6d19ac3

11 files changed

+161
-91
lines changed

Diff for: tests/ui/associated-type-bounds/no-gat-position.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub trait Iter {
55

66
fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>;
77
//~^ ERROR associated item constraints are not allowed here
8+
//~| HELP consider removing this associated item binding
89
}
910

1011
impl Iter for () {

Diff for: tests/ui/associated-type-bounds/no-gat-position.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ error[E0229]: associated item constraints are not allowed here
33
|
44
LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>;
55
| ^^^^^^^^^ associated item constraint not allowed here
6+
|
7+
help: consider removing this associated item binding
8+
|
9+
LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>;
10+
| ~~~~~~~~~~~
611

712
error: aborting due to 1 previous error
813

Diff for: tests/ui/associated-types/associated-types-eq-2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ trait Tr3<const N: i32, T2, T3> {
7676
impl Tr3<N
7777
//~^ ERROR associated item constraints are not allowed here
7878
//~| ERROR associated const equality is incomplete
79-
//~| ERROR trait takes 3 generic arguments but 0 generic arguments were supplied
8079
= 42, T2 = Qux, T3 = usize> for Bar {
8180
}
8281

@@ -92,7 +91,6 @@ impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux {
9291
// matches the const param ident but the constraint is a type arg
9392
impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar {
9493
//~^ ERROR associated item constraints are not allowed here
95-
//~| ERROR trait takes 3 generic arguments but 0 generic arguments were supplied
9694
}
9795

9896
// Test for when equality constraint's ident

Diff for: tests/ui/associated-types/associated-types-eq-2.stderr

+14-48
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | impl Tr3<N
55
| __________^
66
LL | |
77
LL | |
8-
LL | |
98
LL | | = 42, T2 = Qux, T3 = usize> for Bar {
109
| |____^
1110
|
@@ -14,7 +13,7 @@ LL | | = 42, T2 = Qux, T3 = usize> for Bar {
1413
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1514

1615
error[E0658]: associated const equality is incomplete
17-
--> $DIR/associated-types-eq-2.rs:85:10
16+
--> $DIR/associated-types-eq-2.rs:84:10
1817
|
1918
LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux {
2019
| ^^^^^^
@@ -24,7 +23,7 @@ LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux {
2423
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2524

2625
error[E0658]: associated const equality is incomplete
27-
--> $DIR/associated-types-eq-2.rs:100:14
26+
--> $DIR/associated-types-eq-2.rs:98:14
2827
|
2928
LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar {
3029
| ^^^^^^^
@@ -34,7 +33,7 @@ LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar {
3433
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3534

3635
error[E0658]: associated const equality is incomplete
37-
--> $DIR/associated-types-eq-2.rs:108:10
36+
--> $DIR/associated-types-eq-2.rs:106:10
3837
|
3938
LL | impl Tr3<X = 42, Y = Qux, Z = usize> for Bar {
4039
| ^^^^^^
@@ -190,30 +189,13 @@ help: to use `GenericTerm<i32>` as a generic argument specify it directly
190189
LL | impl Tr2<i32, Qux, GenericTerm<i32>> for Bar {
191190
| ~~~~~~~~~~~~~~~~
192191

193-
error[E0107]: trait takes 3 generic arguments but 0 generic arguments were supplied
194-
--> $DIR/associated-types-eq-2.rs:76:6
195-
|
196-
LL | impl Tr3<N
197-
| ^^^ expected 3 generic arguments
198-
|
199-
note: trait defined here, with 3 generic parameters: `N`, `T2`, `T3`
200-
--> $DIR/associated-types-eq-2.rs:69:7
201-
|
202-
LL | trait Tr3<const N: i32, T2, T3> {
203-
| ^^^ ------------ -- --
204-
help: add missing generic arguments
205-
|
206-
LL | impl Tr3<N, T2, T3, N
207-
| ++++++++++
208-
209192
error[E0229]: associated item constraints are not allowed here
210193
--> $DIR/associated-types-eq-2.rs:76:10
211194
|
212195
LL | impl Tr3<N
213196
| __________^
214197
LL | |
215198
LL | |
216-
LL | |
217199
LL | | = 42, T2 = Qux, T3 = usize> for Bar {
218200
| |____^ associated item constraint not allowed here
219201
|
@@ -223,7 +205,7 @@ LL | impl Tr3<42, T2 = Qux, T3 = usize> for Bar {
223205
| ~~
224206

225207
error[E0107]: trait takes 3 generic arguments but 0 generic arguments were supplied
226-
--> $DIR/associated-types-eq-2.rs:85:6
208+
--> $DIR/associated-types-eq-2.rs:84:6
227209
|
228210
LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux {
229211
| ^^^ expected 3 generic arguments
@@ -239,7 +221,7 @@ LL | impl Tr3<N, T2, T3, n = 42, T2 = Qux, T3 = usize> for Qux {
239221
| ++++++++++
240222

241223
error[E0229]: associated item constraints are not allowed here
242-
--> $DIR/associated-types-eq-2.rs:85:10
224+
--> $DIR/associated-types-eq-2.rs:84:10
243225
|
244226
LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux {
245227
| ^^^^^^ associated item constraint not allowed here
@@ -249,24 +231,8 @@ help: consider removing this associated item binding
249231
LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux {
250232
| ~~~~~~~
251233

252-
error[E0107]: trait takes 3 generic arguments but 0 generic arguments were supplied
253-
--> $DIR/associated-types-eq-2.rs:93:6
254-
|
255-
LL | impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar {
256-
| ^^^ expected 3 generic arguments
257-
|
258-
note: trait defined here, with 3 generic parameters: `N`, `T2`, `T3`
259-
--> $DIR/associated-types-eq-2.rs:69:7
260-
|
261-
LL | trait Tr3<const N: i32, T2, T3> {
262-
| ^^^ ------------ -- --
263-
help: add missing generic arguments
264-
|
265-
LL | impl Tr3<N, T2, T3, N = u32, T2 = Qux, T3 = usize> for Bar {
266-
| ++++++++++
267-
268234
error[E0229]: associated item constraints are not allowed here
269-
--> $DIR/associated-types-eq-2.rs:93:10
235+
--> $DIR/associated-types-eq-2.rs:92:10
270236
|
271237
LL | impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar {
272238
| ^^^^^^^ associated item constraint not allowed here
@@ -277,7 +243,7 @@ LL | impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar {
277243
| ~~~~~~~~
278244

279245
error[E0107]: trait takes 3 generic arguments but 1 generic argument was supplied
280-
--> $DIR/associated-types-eq-2.rs:100:6
246+
--> $DIR/associated-types-eq-2.rs:98:6
281247
|
282248
LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar {
283249
| ^^^ -- supplied 1 generic argument
@@ -295,7 +261,7 @@ LL | impl Tr3<42, T2, T3, T2 = 42, T3 = usize> for Bar {
295261
| ++++++++
296262

297263
error[E0229]: associated item constraints are not allowed here
298-
--> $DIR/associated-types-eq-2.rs:100:14
264+
--> $DIR/associated-types-eq-2.rs:98:14
299265
|
300266
LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar {
301267
| ^^^^^^^ associated item constraint not allowed here
@@ -306,7 +272,7 @@ LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar {
306272
| ~~~~~~~~~
307273

308274
error[E0107]: trait takes 3 generic arguments but 0 generic arguments were supplied
309-
--> $DIR/associated-types-eq-2.rs:108:6
275+
--> $DIR/associated-types-eq-2.rs:106:6
310276
|
311277
LL | impl Tr3<X = 42, Y = Qux, Z = usize> for Bar {
312278
| ^^^ expected 3 generic arguments
@@ -322,7 +288,7 @@ LL | impl Tr3<N, T2, T3, X = 42, Y = Qux, Z = usize> for Bar {
322288
| ++++++++++
323289

324290
error[E0229]: associated item constraints are not allowed here
325-
--> $DIR/associated-types-eq-2.rs:108:10
291+
--> $DIR/associated-types-eq-2.rs:106:10
326292
|
327293
LL | impl Tr3<X = 42, Y = Qux, Z = usize> for Bar {
328294
| ^^^^^^ associated item constraint not allowed here
@@ -333,13 +299,13 @@ LL | impl Tr3<X = 42, Y = Qux, Z = usize> for Bar {
333299
| ~~~~~~~
334300

335301
error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
336-
--> $DIR/associated-types-eq-2.rs:119:13
302+
--> $DIR/associated-types-eq-2.rs:117:13
337303
|
338304
LL | impl<'a, T> St<'a , T = Qux> {
339305
| ^^ expected 1 generic argument
340306
|
341307
note: struct defined here, with 1 generic parameter: `T`
342-
--> $DIR/associated-types-eq-2.rs:117:8
308+
--> $DIR/associated-types-eq-2.rs:115:8
343309
|
344310
LL | struct St<'a, T> { v: &'a T }
345311
| ^^ -
@@ -349,7 +315,7 @@ LL | impl<'a, T> St<'a, T , T = Qux> {
349315
| +++
350316

351317
error[E0229]: associated item constraints are not allowed here
352-
--> $DIR/associated-types-eq-2.rs:119:21
318+
--> $DIR/associated-types-eq-2.rs:117:21
353319
|
354320
LL | impl<'a, T> St<'a , T = Qux> {
355321
| ^^^^^^^ associated item constraint not allowed here
@@ -359,7 +325,7 @@ help: to use `Qux` as a generic argument specify it directly
359325
LL | impl<'a, T> St<'a , Qux> {
360326
| ~~~
361327

362-
error: aborting due to 27 previous errors
328+
error: aborting due to 25 previous errors
363329

364330
Some errors have detailed explanations: E0046, E0107, E0229, E0658.
365331
For more information about an error, try `rustc --explain E0046`.

Diff for: tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ error[E0229]: associated item constraints are not allowed here
1212
|
1313
LL | impl Super1<'_, bar(): Send> for () {}
1414
| ^^^^^^^^^^^ associated item constraint not allowed here
15+
|
16+
help: consider removing this associated item binding
17+
|
18+
LL | impl Super1<'_, bar(): Send> for () {}
19+
| ~~~~~~~~~~~~~
1520

1621
error[E0046]: not all trait items implemented, missing: `bar`
1722
--> $DIR/rtn-in-impl-signature.rs:10:1

Diff for: tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ struct Bar;
77
const T: usize = 42;
88

99
impl Foo<N = 3> for Bar {
10-
//~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied
11-
//~| ERROR associated item constraints are not allowed here
10+
//~^ ERROR associated item constraints are not allowed here
1211
//~| ERROR associated const equality is incomplete
1312
fn do_x(&self) -> [u8; 3] {
1413
[0u8; 3]

Diff for: tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr

+3-19
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@ LL | impl Foo<N = 3> for Bar {
88
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

11-
error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
12-
--> $DIR/issue-89013-no-kw.rs:9:6
13-
|
14-
LL | impl Foo<N = 3> for Bar {
15-
| ^^^ expected 1 generic argument
16-
|
17-
note: trait defined here, with 1 generic parameter: `N`
18-
--> $DIR/issue-89013-no-kw.rs:1:7
19-
|
20-
LL | trait Foo<const N: usize> {
21-
| ^^^ --------------
22-
help: add missing generic argument
23-
|
24-
LL | impl Foo<N, N = 3> for Bar {
25-
| ++
26-
2711
error[E0229]: associated item constraints are not allowed here
2812
--> $DIR/issue-89013-no-kw.rs:9:10
2913
|
@@ -35,7 +19,7 @@ help: to use `3` as a generic argument specify it directly
3519
LL | impl Foo<3> for Bar {
3620
| ~
3721

38-
error: aborting due to 3 previous errors
22+
error: aborting due to 2 previous errors
3923

40-
Some errors have detailed explanations: E0107, E0229, E0658.
41-
For more information about an error, try `rustc --explain E0107`.
24+
Some errors have detailed explanations: E0229, E0658.
25+
For more information about an error, try `rustc --explain E0229`.

Diff for: tests/ui/const-generics/parser-error-recovery/issue-89013.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const T: usize = 42;
88

99
impl Foo<N = const 3> for Bar {
1010
//~^ ERROR expected lifetime, type, or constant, found keyword `const`
11-
//~| ERROR trait takes 1 generic
1211
//~| ERROR associated item constraints are not allowed here
1312
//~| ERROR associated const equality is incomplete
1413
fn do_x(&self) -> [u8; 3] {

Diff for: tests/ui/const-generics/parser-error-recovery/issue-89013.stderr

+3-19
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@ LL | impl Foo<N = const 3> for Bar {
2020
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
2121
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2222

23-
error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
24-
--> $DIR/issue-89013.rs:9:6
25-
|
26-
LL | impl Foo<N = const 3> for Bar {
27-
| ^^^ expected 1 generic argument
28-
|
29-
note: trait defined here, with 1 generic parameter: `N`
30-
--> $DIR/issue-89013.rs:1:7
31-
|
32-
LL | trait Foo<const N: usize> {
33-
| ^^^ --------------
34-
help: add missing generic argument
35-
|
36-
LL | impl Foo<N, N = const 3> for Bar {
37-
| ++
38-
3923
error[E0229]: associated item constraints are not allowed here
4024
--> $DIR/issue-89013.rs:9:10
4125
|
@@ -47,7 +31,7 @@ help: to use `3` as a generic argument specify it directly
4731
LL | impl Foo<3> for Bar {
4832
| ~
4933

50-
error: aborting due to 4 previous errors
34+
error: aborting due to 3 previous errors
5135

52-
Some errors have detailed explanations: E0107, E0229, E0658.
53-
For more information about an error, try `rustc --explain E0107`.
36+
Some errors have detailed explanations: E0229, E0658.
37+
For more information about an error, try `rustc --explain E0229`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
trait Foo<T> {}
2+
3+
impl Foo<T: Default> for String {}
4+
//~^ ERROR associated item constraints are not allowed here
5+
//~| HELP declare the type parameter right after the `impl` keyword
6+
7+
impl Foo<T: 'a + Default> for u8 {}
8+
//~^ ERROR associated item constraints are not allowed here
9+
//~| HELP declare the type parameter right after the `impl` keyword
10+
//~| ERROR use of undeclared lifetime name `'a`
11+
//~| HELP consider introducing lifetime `'a` here
12+
13+
impl<T> Foo<T: Default> for u16 {}
14+
//~^ ERROR associated item constraints are not allowed here
15+
//~| HELP declare the type parameter right after the `impl` keyword
16+
17+
impl<'a> Foo<T: 'a + Default> for u32 {}
18+
//~^ ERROR associated item constraints are not allowed here
19+
//~| HELP declare the type parameter right after the `impl` keyword
20+
21+
trait Bar<T, K> {}
22+
23+
impl Bar<T: Default, K: Default> for String {}
24+
//~^ ERROR associated item constraints are not allowed here
25+
//~| HELP declare the type parameter right after the `impl` keyword
26+
27+
impl<T> Bar<T, K: Default> for u8 {}
28+
//~^ ERROR trait takes 2 generic arguments but 1 generic argument was supplied
29+
//~| HELP add missing generic argument
30+
//~| ERROR associated item constraints are not allowed here
31+
//~| HELP declare the type parameter right after the `impl` keyword
32+
33+
fn main() {}

0 commit comments

Comments
 (0)