rust/tests/ui/impl-trait/unsized_coercion3.next.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-10-14 12:04:10 -05:00
error[E0277]: the trait bound `dyn Send: Trait` is not satisfied
--> $DIR/unsized_coercion3.rs:14:17
2024-05-31 04:51:10 -05:00
|
LL | let x = hello();
2024-10-14 12:04:10 -05:00
| ^^^^^^^ the trait `Trait` is not implemented for `dyn Send`
|
= help: the trait `Trait` is implemented for `u32`
2024-05-31 04:51:10 -05:00
error[E0308]: mismatched types
2024-10-14 12:04:10 -05:00
--> $DIR/unsized_coercion3.rs:19:5
2024-05-31 04:51:10 -05:00
|
LL | fn hello() -> Box<impl Trait + ?Sized> {
2024-10-14 09:52:34 -05:00
| ------------------------
| | |
| | the expected opaque type
| expected `Box<impl Trait + ?Sized>` because of return type
2024-05-31 04:51:10 -05:00
...
LL | Box::new(1u32)
2024-10-14 09:52:34 -05:00
| ^^^^^^^^^^^^^^ types differ
2024-05-31 04:51:10 -05:00
|
2024-10-14 09:52:34 -05:00
= note: expected struct `Box<impl Trait + ?Sized>`
found struct `Box<u32>`
2024-05-31 04:51:10 -05:00
2024-10-14 12:04:10 -05:00
error[E0277]: the trait bound `dyn Send: Trait` is not satisfied
2024-10-14 09:52:34 -05:00
--> $DIR/unsized_coercion3.rs:11:1
|
LL | fn hello() -> Box<impl Trait + ?Sized> {
2024-10-14 12:04:10 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Send`
|
= help: the trait `Trait` is implemented for `u32`
2024-05-31 04:51:10 -05:00
2024-10-14 12:04:10 -05:00
error: aborting due to 3 previous errors
2024-05-31 04:51:10 -05:00
2024-10-14 12:04:10 -05:00
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.