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 | ----- the trait cannot require that `Self : Sized`
7 LL | let t_box: Box<dyn Trait> = Box::new(S);
8 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
10 = note: the trait cannot require that `Self : Sized`
11 = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn Trait>>` for `std::boxed::Box<S>`
12 = note: required by cast to type `std::boxed::Box<dyn Trait>`
14 error[E0038]: the trait `Trait` cannot be made into an object
15 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:17:15
17 LL | trait Trait: Sized {}
18 | ----- the trait cannot require that `Self : Sized`
20 LL | takes_box(Box::new(S));
21 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
23 = note: the trait cannot require that `Self : Sized`
24 = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn Trait>>` for `std::boxed::Box<S>`
25 = note: required by cast to type `std::boxed::Box<(dyn Trait + 'static)>`
27 error[E0038]: the trait `Trait` cannot be made into an object
28 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:15:5
30 LL | trait Trait: Sized {}
31 | ----- the trait cannot require that `Self : Sized`
33 LL | Box::new(S) as Box<dyn Trait>;
34 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
36 = note: the trait cannot require that `Self : Sized`
37 = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn Trait>>` for `std::boxed::Box<S>`
38 = note: required by cast to type `std::boxed::Box<dyn Trait>`
40 error: aborting due to 3 previous errors
42 For more information about this error, try `rustc --explain E0038`.