mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
39 lines
1.7 KiB
Plaintext
39 lines
1.7 KiB
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/unsized_coercion5.rs:16:32
|
|
|
|
|
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
|
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `Send`, found trait `Trait + Send`
|
|
| |
|
|
| expected due to this
|
|
|
|
|
= note: expected struct `Box<dyn Send>`
|
|
found struct `Box<dyn Trait + Send>`
|
|
|
|
error: cannot check whether the hidden type of opaque type satisfies auto traits
|
|
--> $DIR/unsized_coercion5.rs:16:32
|
|
|
|
|
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
|
| ^
|
|
|
|
|
= 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
|
|
note: opaque type is declared here
|
|
--> $DIR/unsized_coercion5.rs:13:19
|
|
|
|
|
LL | fn hello() -> Box<impl Trait + ?Sized> {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>`
|
|
|
|
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
|
|
--> $DIR/unsized_coercion5.rs:16:32
|
|
|
|
|
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
|
| ^ doesn't have a size known at compile-time
|
|
|
|
|
= help: the trait `Sized` is not implemented for `impl Trait + ?Sized`
|
|
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
Some errors have detailed explanations: E0277, E0308.
|
|
For more information about an error, try `rustc --explain E0277`.
|