error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time --> $DIR/unsized_coercion.rs:15:17 | LL | let x = hello(); | ^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn Trait` error[E0308]: mismatched types --> $DIR/unsized_coercion.rs:19:5 | LL | fn hello() -> Box { | --------------- | | | | | the expected opaque type | expected `Box` because of return type ... LL | Box::new(1u32) | ^^^^^^^^^^^^^^ types differ | = note: expected struct `Box` found struct `Box` error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time --> $DIR/unsized_coercion.rs:12:1 | LL | fn hello() -> Box { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn Trait` error: aborting due to 3 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`.