|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/unsized_coercion5.rs:17:32 |
| 3 | + | |
| 4 | +LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>; |
| 5 | + | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `Send`, found trait `Trait + Send` |
| 6 | + | | |
| 7 | + | expected due to this |
| 8 | + | |
| 9 | + = note: expected struct `Box<dyn Send>` |
| 10 | + found struct `Box<dyn Trait + Send>` |
| 11 | + |
| 12 | +error: cannot check whether the hidden type of opaque type satisfies auto traits |
| 13 | + --> $DIR/unsized_coercion5.rs:17:32 |
| 14 | + | |
| 15 | +LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>; |
| 16 | + | ^ |
| 17 | + | |
| 18 | + = note: fetching the hidden types of an opaque inside of the defining scope is not supported. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule |
| 19 | +note: opaque type is declared here |
| 20 | + --> $DIR/unsized_coercion5.rs:14:19 |
| 21 | + | |
| 22 | +LL | fn hello() -> Box<impl Trait + ?Sized> { |
| 23 | + | ^^^^^^^^^^^^^^^^^^^ |
| 24 | + = note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>` |
| 25 | + |
| 26 | +error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time |
| 27 | + --> $DIR/unsized_coercion5.rs:17:32 |
| 28 | + | |
| 29 | +LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>; |
| 30 | + | ^ doesn't have a size known at compile-time |
| 31 | + | |
| 32 | + = help: the trait `Sized` is not implemented for `impl Trait + ?Sized` |
| 33 | + = note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>` |
| 34 | + |
| 35 | +error: aborting due to 3 previous errors |
| 36 | + |
| 37 | +Some errors have detailed explanations: E0277, E0308. |
| 38 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments