error: trivial cast: `&Bar` as `&dyn Foo`
--> $DIR/trivial_casts.rs:52:13
|
-LL | let _ = x as &Foo;
- | ^^^^^^^^^
+LL | let _ = x as &dyn Foo;
+ | ^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&Bar` as `*const dyn Foo`
--> $DIR/trivial_casts.rs:53:13
|
-LL | let _ = x as *const Foo;
- | ^^^^^^^^^^^^^^^
+LL | let _ = x as *const dyn Foo;
+ | ^^^^^^^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&mut Bar` as `&mut dyn Foo`
--> $DIR/trivial_casts.rs:58:13
|
-LL | let _ = x as &mut Foo;
- | ^^^^^^^^^^^^^
+LL | let _ = x as &mut dyn Foo;
+ | ^^^^^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&mut Bar` as `*mut dyn Foo`
--> $DIR/trivial_casts.rs:59:13
|
-LL | let _ = x as *mut Foo;
- | ^^^^^^^^^^^^^
+LL | let _ = x as *mut dyn Foo;
+ | ^^^^^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `std::boxed::Box<Bar>` as `std::boxed::Box<dyn Foo>`
--> $DIR/trivial_casts.rs:64:13
|
-LL | let _ = x as Box<Foo>;
- | ^^^^^^^^^^^^^
+LL | let _ = x as Box<dyn Foo>;
+ | ^^^^^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&fn(i32) {main::baz}` as `&dyn std::ops::Fn(i32)`
--> $DIR/trivial_casts.rs:70:13
|
-LL | let _ = &baz as &Fn(i32);
- | ^^^^^^^^^^^^^^^^
+LL | let _ = &baz as &dyn Fn(i32);
+ | ^^^^^^^^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&[closure@$DIR/trivial_casts.rs:72:13: 72:25]` as `&dyn std::ops::Fn(i32)`
--> $DIR/trivial_casts.rs:73:13
|
-LL | let _ = &x as &Fn(i32);
- | ^^^^^^^^^^^^^^
+LL | let _ = &x as &dyn Fn(i32);
+ | ^^^^^^^^^^^^^^^^^^
|
= help: cast can be replaced by coercion; this might require a temporary variable