Skip to content

Commit eb4580a

Browse files
committed
Update ui test suite to use dyn
1 parent a1d1d7a commit eb4580a

File tree

529 files changed

+1620
-1605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

529 files changed

+1620
-1605
lines changed

src/test/ui/anonymous-higher-ranked-lifetime.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
3131
fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
3232

3333
// Nested
34-
fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
34+
fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
3535
fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
36-
fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
36+
fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
3737
fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
3838

3939
// Mixed
40-
fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
41-
fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
40+
fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
41+
fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}

src/test/ui/anonymous-higher-ranked-lifetime.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ LL | g1(|_: (), _: ()| {});
149149
note: required by `g1`
150150
--> $DIR/anonymous-higher-ranked-lifetime.rs:34:1
151151
|
152-
LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
153-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152+
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
153+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154154

155155
error[E0631]: type mismatch in closure arguments
156156
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@@ -163,8 +163,8 @@ LL | g1(|_: (), _: ()| {});
163163
note: required by `g1`
164164
--> $DIR/anonymous-higher-ranked-lifetime.rs:34:1
165165
|
166-
LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
167-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166+
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
167+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168168

169169
error[E0631]: type mismatch in closure arguments
170170
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
@@ -205,8 +205,8 @@ LL | g3(|_: (), _: ()| {});
205205
note: required by `g3`
206206
--> $DIR/anonymous-higher-ranked-lifetime.rs:36:1
207207
|
208-
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
209-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208+
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
209+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210210

211211
error[E0631]: type mismatch in closure arguments
212212
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
@@ -219,8 +219,8 @@ LL | g3(|_: (), _: ()| {});
219219
note: required by `g3`
220220
--> $DIR/anonymous-higher-ranked-lifetime.rs:36:1
221221
|
222-
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
223-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222+
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
223+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
224224

225225
error[E0631]: type mismatch in closure arguments
226226
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
@@ -261,8 +261,8 @@ LL | h1(|_: (), _: (), _: (), _: ()| {});
261261
note: required by `h1`
262262
--> $DIR/anonymous-higher-ranked-lifetime.rs:40:1
263263
|
264-
LL | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
265-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
264+
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
265+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
266266

267267
error[E0631]: type mismatch in closure arguments
268268
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
@@ -275,8 +275,8 @@ LL | h1(|_: (), _: (), _: (), _: ()| {});
275275
note: required by `h1`
276276
--> $DIR/anonymous-higher-ranked-lifetime.rs:40:1
277277
|
278-
LL | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
279-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278+
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
279+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
280280

281281
error[E0631]: type mismatch in closure arguments
282282
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
@@ -289,8 +289,8 @@ LL | h2(|_: (), _: (), _: (), _: ()| {});
289289
note: required by `h2`
290290
--> $DIR/anonymous-higher-ranked-lifetime.rs:41:1
291291
|
292-
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
293-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
292+
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
293+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
294294

295295
error[E0631]: type mismatch in closure arguments
296296
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
@@ -303,8 +303,8 @@ LL | h2(|_: (), _: (), _: (), _: ()| {});
303303
note: required by `h2`
304304
--> $DIR/anonymous-higher-ranked-lifetime.rs:41:1
305305
|
306-
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
307-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
306+
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
307+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
308308

309309
error: aborting due to 22 previous errors
310310

src/test/ui/associated-const/associated-const-in-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait Trait {
66
const N: usize;
77
}
88

9-
impl Trait {
9+
impl dyn Trait {
1010
//~^ ERROR the trait `Trait` cannot be made into an object [E0038]
1111
const fn n() -> usize { Self::N }
1212
}

src/test/ui/associated-const/associated-const-in-trait.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0038]: the trait `Trait` cannot be made into an object
22
--> $DIR/associated-const-in-trait.rs:9:6
33
|
4-
LL | impl Trait {
5-
| ^^^^^ the trait `Trait` cannot be made into an object
4+
LL | impl dyn Trait {
5+
| ^^^^^^^^^ the trait `Trait` cannot be made into an object
66
|
77
= note: the trait cannot contain associated consts like `N`
88

src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn dent<C:BoxCar>(c: C, color: C::Color) {
2020
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
2121
}
2222

23-
fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
23+
fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
2424
//~^ ERROR ambiguous associated type
2525
//~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified
2626
}

src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ LL | fn dent<C:BoxCar>(c: C, color: C::Color) {
1111
| ^^^^^^^^ ambiguous associated type `Color`
1212

1313
error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar`
14-
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:33
14+
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:37
1515
|
1616
LL | type Color;
1717
| ----------- ambiguous `Color` from `Vehicle`
1818
...
1919
LL | type Color;
2020
| ----------- ambiguous `Color` from `Box`
2121
...
22-
LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
23-
| ^^^^^^^^^^^ ambiguous associated type `Color`
22+
LL | fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
23+
| ^^^^^^^^^^^ ambiguous associated type `Color`
2424

2525
error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
2626
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:26
2727
|
2828
LL | type Color;
2929
| ----------- `Color` defined here
3030
...
31-
LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
32-
| ^^^^^^^^^^^^^^^^^^^ associated type `Color` must be specified
31+
LL | fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
32+
| ^^^^^^^^^^^^^^^^^^^^^^^ associated type `Color` must be specified
3333

3434
error[E0221]: ambiguous associated type `Color` in bounds of `C`
3535
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:28:29

src/test/ui/associated-types/associated-types-eq-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn foo2<I: Foo>(x: I) {
2828
}
2929

3030

31-
pub fn baz(x: &Foo<A=Bar>) {
31+
pub fn baz(x: &dyn Foo<A=Bar>) {
3232
let _: Bar = x.boo();
3333
}
3434

src/test/ui/associated-types/associated-types-incomplete-object.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ impl Foo for isize {
1818
}
1919

2020
pub fn main() {
21-
let a = &42isize as &Foo<A=usize, B=char>;
21+
let a = &42isize as &dyn Foo<A=usize, B=char>;
2222

23-
let b = &42isize as &Foo<A=usize>;
23+
let b = &42isize as &dyn Foo<A=usize>;
2424
//~^ ERROR the value of the associated type `B` (from the trait `Foo`) must be specified
2525

26-
let c = &42isize as &Foo<B=char>;
26+
let c = &42isize as &dyn Foo<B=char>;
2727
//~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified
2828

29-
let d = &42isize as &Foo;
29+
let d = &42isize as &dyn Foo;
3030
//~^ ERROR the value of the associated types `A` (from the trait `Foo`), `B` (from the trait
3131
}

src/test/ui/associated-types/associated-types-incomplete-object.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ error[E0191]: the value of the associated type `B` (from the trait `Foo`) must b
44
LL | type B;
55
| ------- `B` defined here
66
...
7-
LL | let b = &42isize as &Foo<A=usize>;
8-
| ^^^^^^^^^^^^ associated type `B` must be specified
7+
LL | let b = &42isize as &dyn Foo<A=usize>;
8+
| ^^^^^^^^^^^^^^^^ associated type `B` must be specified
99

1010
error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified
1111
--> $DIR/associated-types-incomplete-object.rs:26:26
1212
|
1313
LL | type A;
1414
| ------- `A` defined here
1515
...
16-
LL | let c = &42isize as &Foo<B=char>;
17-
| ^^^^^^^^^^^ associated type `A` must be specified
16+
LL | let c = &42isize as &dyn Foo<B=char>;
17+
| ^^^^^^^^^^^^^^^ associated type `A` must be specified
1818

1919
error[E0191]: the value of the associated types `A` (from the trait `Foo`), `B` (from the trait `Foo`) must be specified
2020
--> $DIR/associated-types-incomplete-object.rs:29:26
@@ -24,8 +24,8 @@ LL | type A;
2424
LL | type B;
2525
| ------- `B` defined here
2626
...
27-
LL | let d = &42isize as &Foo;
28-
| ^^^
27+
LL | let d = &42isize as &dyn Foo;
28+
| ^^^^^^^
2929
| |
3030
| associated type `A` must be specified
3131
| associated type `B` must be specified

src/test/ui/associated-types/associated-types-overridden-binding-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
trait I32Iterator = Iterator<Item = i32>;
44

55
fn main() {
6-
let _: &I32Iterator<Item = u32> = &vec![42].into_iter();
6+
let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
77
//~^ ERROR type mismatch
88
}

0 commit comments

Comments
 (0)