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

+4-4
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

+16-16
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

+1-1
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

+2-2
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

+1-1
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

+5-5
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

+1-1
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

+4-4
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

+6-6
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

+1-1
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
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as std::iter::Iterator>::Item == i32`
2-
--> $DIR/associated-types-overridden-binding-2.rs:6:39
2+
--> $DIR/associated-types-overridden-binding-2.rs:6:43
33
|
4-
LL | let _: &I32Iterator<Item = u32> = &vec![42].into_iter();
5-
| ^^^^^^^^^^^^^^^^^^^^^ expected u32, found i32
4+
LL | let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
5+
| ^^^^^^^^^^^^^^^^^^^^^ expected u32, found i32
66
|
77
= note: expected type `u32`
88
found type `i32`

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ trait I32Iterator = Iterator<Item = i32>;
77
trait U32Iterator = I32Iterator<Item = u32>;
88

99
fn main() {
10-
let _: &I32Iterator<Item = u32>;
10+
let _: &dyn I32Iterator<Item = u32>;
1111
}

src/test/ui/associated-types/bound-lifetime-constrained.object.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
2-
--> $DIR/bound-lifetime-constrained.rs:28:56
2+
--> $DIR/bound-lifetime-constrained.rs:28:60
33
|
4-
LL | fn object1(_: Box<for<'a> Fn(<() as Foo<'a>>::Item) -> &'a i32>) {
5-
| ^^^^^^^
4+
LL | fn object1(_: Box<dyn for<'a> Fn(<() as Foo<'a>>::Item) -> &'a i32>) {
5+
| ^^^^^^^
66

77
error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
8-
--> $DIR/bound-lifetime-constrained.rs:33:35
8+
--> $DIR/bound-lifetime-constrained.rs:33:39
99
|
10-
LL | fn object2(_: Box<for<'a> Fn() -> <() as Foo<'a>>::Item>) {
11-
| ^^^^^^^^^^^^^^^^^^^^^
10+
LL | fn object2(_: Box<dyn for<'a> Fn() -> <() as Foo<'a>>::Item>) {
11+
| ^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: aborting due to 2 previous errors
1414

src/test/ui/associated-types/bound-lifetime-constrained.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ fn func2(_: for<'a> fn() -> <() as Foo<'a>>::Item) {
2525
}
2626

2727
#[cfg(object)]
28-
fn object1(_: Box<for<'a> Fn(<() as Foo<'a>>::Item) -> &'a i32>) {
28+
fn object1(_: Box<dyn for<'a> Fn(<() as Foo<'a>>::Item) -> &'a i32>) {
2929
//[object]~^ ERROR E0582
3030
}
3131

3232
#[cfg(object)]
33-
fn object2(_: Box<for<'a> Fn() -> <() as Foo<'a>>::Item>) {
33+
fn object2(_: Box<dyn for<'a> Fn() -> <() as Foo<'a>>::Item>) {
3434
//[object]~^ ERROR E0582
3535
}
3636

src/test/ui/associated-types/bound-lifetime-in-binding-only.angle.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ LL | fn angle2<T>() where for<'a> T: Foo<Item=&'a i32> {
1717
| ^^^^^^^^^^^^
1818

1919
error[E0582]: binding for associated type `Item` references lifetime `'a`, which does not appear in the trait input types
20-
--> $DIR/bound-lifetime-in-binding-only.rs:27:27
20+
--> $DIR/bound-lifetime-in-binding-only.rs:27:31
2121
|
22-
LL | fn angle3(_: &for<'a> Foo<Item=&'a i32>) {
23-
| ^^^^^^^^^^^^
22+
LL | fn angle3(_: &dyn for<'a> Foo<Item=&'a i32>) {
23+
| ^^^^^^^^^^^^
2424

2525
error: aborting due to 4 previous errors
2626

src/test/ui/associated-types/bound-lifetime-in-binding-only.paren.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ LL | fn paren2<T>() where for<'a> T: Fn() -> &'a i32 {
1717
| ^^^^^^^
1818

1919
error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
20-
--> $DIR/bound-lifetime-in-binding-only.rs:47:31
20+
--> $DIR/bound-lifetime-in-binding-only.rs:47:35
2121
|
22-
LL | fn paren3(_: &for<'a> Fn() -> &'a i32) {
23-
| ^^^^^^^
22+
LL | fn paren3(_: &dyn for<'a> Fn() -> &'a i32) {
23+
| ^^^^^^^
2424

2525
error: aborting due to 4 previous errors
2626

src/test/ui/associated-types/bound-lifetime-in-binding-only.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn angle2<T>() where for<'a> T: Foo<Item=&'a i32> {
2424
}
2525

2626
#[cfg(angle)]
27-
fn angle3(_: &for<'a> Foo<Item=&'a i32>) {
27+
fn angle3(_: &dyn for<'a> Foo<Item=&'a i32>) {
2828
//[angle]~^ ERROR binding for associated type `Item` references lifetime `'a`
2929
}
3030

@@ -44,7 +44,7 @@ fn paren2<T>() where for<'a> T: Fn() -> &'a i32 {
4444
}
4545

4646
#[cfg(paren)]
47-
fn paren3(_: &for<'a> Fn() -> &'a i32) {
47+
fn paren3(_: &dyn for<'a> Fn() -> &'a i32) {
4848
//[paren]~^ ERROR binding for associated type `Output` references lifetime `'a`
4949
}
5050

src/test/ui/associated-types/bound-lifetime-in-return-only.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ fn elision(_: fn() -> &i32) {
3838
struct Parameterized<'a> { x: &'a str }
3939

4040
#[cfg(ok)]
41-
fn ok1(_: &for<'a> Fn(&Parameterized<'a>) -> &'a i32) {
41+
fn ok1(_: &dyn for<'a> Fn(&Parameterized<'a>) -> &'a i32) {
4242
}
4343

4444
#[cfg(ok)]
45-
fn ok2(_: &for<'a,'b> Fn<(&'b Parameterized<'a>,), Output=&'a i32>) {
45+
fn ok2(_: &dyn for<'a,'b> Fn<(&'b Parameterized<'a>,), Output=&'a i32>) {
4646
}
4747

4848
#[rustc_error]

src/test/ui/async-await/async-with-closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct MyStream<C: ?Sized + MyClosure> {
1919
async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}
2020

2121
async fn f() {
22-
let messages: MyStream<FnMut()> = unimplemented!();
22+
let messages: MyStream<dyn FnMut()> = unimplemented!();
2323
await!(get_future(messages));
2424
}
2525

src/test/ui/async-await/issues/issue-53249.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<R, F> Future for Lazy<F>
3535
}
3636

3737
async fn __receive<WantFn, Fut>(want: WantFn) -> ()
38-
where Fut: Future<Output = ()>, WantFn: Fn(&Box<Send + 'static>) -> Fut,
38+
where Fut: Future<Output = ()>, WantFn: Fn(&Box<dyn Send + 'static>) -> Fut,
3939
{
4040
await!(lazy(|_| ()));
4141
}

src/test/ui/async-await/issues/issue-54974.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait SomeTrait: Send + Sync + 'static {
99
fn do_something(&self);
1010
}
1111

12-
async fn my_task(obj: Arc<SomeTrait>) {
12+
async fn my_task(obj: Arc<dyn SomeTrait>) {
1313
unimplemented!()
1414
}
1515

src/test/ui/bad/bad-sized.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
trait Trait {}
22

33
pub fn main() {
4-
let x: Vec<Trait + Sized> = Vec::new();
4+
let x: Vec<dyn Trait + Sized> = Vec::new();
55
//~^ ERROR only auto traits can be used as additional traits in a trait object
66
//~| ERROR the size for values of type
77
//~| ERROR the size for values of type

0 commit comments

Comments
 (0)