Skip to content

Commit c1b8141

Browse files
committed
Add dyn annotation to trait object arguments
1 parent 3bdcbbf commit c1b8141

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test-project/tests/compile-fail/trait-bounds-cant-coerce.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ trait Foo {
1313
fn dummy(&self) { }
1414
}
1515

16-
fn a(_x: Box<Foo+Send>) {
16+
fn a(_x: Box<dyn Foo+Send>) {
1717
}
1818

19-
fn c(x: Box<Foo+Sync+Send>) {
19+
fn c(x: Box<dyn Foo+Sync+Send>) {
2020
a(x);
2121
}
2222

23-
fn d(x: Box<Foo>) {
23+
fn d(x: Box<dyn Foo>) {
2424
a(x); //~ ERROR mismatched types
2525
//~| expected trait `Foo + std::marker::Send`, found trait `Foo`
2626
//~| expected type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>`

0 commit comments

Comments
 (0)