1 error[E0038]: the trait `Trait` cannot be made into an object
2 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:16:33
4 LL | trait Trait: Sized {}
5 | ----- traits that require `Self: Sized` cannot be made into an object
7 LL | let t_box: Box<dyn Trait> = Box::new(S);
8 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
10 = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn Trait>>` for `std::boxed::Box<S>`
11 = note: required by cast to type `std::boxed::Box<dyn Trait>`
13 error[E0038]: the trait `Trait` cannot be made into an object
14 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:17:15
16 LL | trait Trait: Sized {}
17 | ----- traits that require `Self: Sized` cannot be made into an object
19 LL | takes_box(Box::new(S));
20 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
22 = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn Trait>>` for `std::boxed::Box<S>`
23 = note: required by cast to type `std::boxed::Box<(dyn Trait + 'static)>`
25 error[E0038]: the trait `Trait` cannot be made into an object
26 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:15:5
28 LL | trait Trait: Sized {}
29 | ----- traits that require `Self: Sized` cannot be made into an object
31 LL | Box::new(S) as Box<dyn Trait>;
32 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
34 = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn Trait>>` for `std::boxed::Box<S>`
35 = note: required by cast to type `std::boxed::Box<dyn Trait>`
37 error: aborting due to 3 previous errors
39 For more information about this error, try `rustc --explain E0038`.