@@ -9,7 +9,37 @@ help: the trait `Trait` is implemented for `u32`
99 |
1010LL | impl Trait for u32 {}
1111 | ^^^^^^^^^^^^^^^^^^
12+ note: required by a bound in `Box`
13+ --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
1214
13- error: aborting due to 1 previous error
15+ error[E0308]: mismatched types
16+ --> $DIR/unsized_coercion3.rs:18:5
17+ |
18+ LL | fn hello() -> Box<impl Trait + ?Sized> {
19+ | ------------------------
20+ | | |
21+ | | the expected opaque type
22+ | expected `Box<impl Trait + ?Sized>` because of return type
23+ ...
24+ LL | Box::new(1u32)
25+ | ^^^^^^^^^^^^^^ types differ
26+ |
27+ = note: expected struct `Box<impl Trait + ?Sized>`
28+ found struct `Box<u32>`
29+
30+ error[E0277]: the trait bound `dyn Send: Trait` is not satisfied
31+ --> $DIR/unsized_coercion3.rs:11:1
32+ |
33+ LL | fn hello() -> Box<impl Trait + ?Sized> {
34+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Send`
35+ |
36+ help: the trait `Trait` is implemented for `u32`
37+ --> $DIR/unsized_coercion3.rs:9:1
38+ |
39+ LL | impl Trait for u32 {}
40+ | ^^^^^^^^^^^^^^^^^^
41+
42+ error: aborting due to 3 previous errors
1443
15- For more information about this error, try `rustc --explain E0277`.
44+ Some errors have detailed explanations: E0277, E0308.
45+ For more information about an error, try `rustc --explain E0277`.
0 commit comments