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 | let t_box: Box<dyn Trait> = Box::new(S);
5 | ^^^^^^^^^^^ `Trait` cannot be made into an object
7 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
8 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:6:14
10 LL | trait Trait: Sized {}
11 | ----- ^^^^^ ...because it requires `Self: Sized`
13 | this trait cannot be made into an object...
14 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
15 = note: required by cast to type `Box<dyn Trait>`
17 error[E0038]: the trait `Trait` cannot be made into an object
18 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:17:15
20 LL | takes_box(Box::new(S));
21 | ^^^^^^^^^^^ `Trait` cannot be made into an object
23 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
24 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:6:14
26 LL | trait Trait: Sized {}
27 | ----- ^^^^^ ...because it requires `Self: Sized`
29 | this trait cannot be made into an object...
30 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
31 = note: required by cast to type `Box<(dyn Trait + 'static)>`
33 error[E0038]: the trait `Trait` cannot be made into an object
34 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:15:5
36 LL | Box::new(S) as Box<dyn Trait>;
37 | ^^^^^^^^^^^ `Trait` cannot be made into an object
39 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
40 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:6:14
42 LL | trait Trait: Sized {}
43 | ----- ^^^^^ ...because it requires `Self: Sized`
45 | this trait cannot be made into an object...
46 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
47 = note: required by cast to type `Box<dyn Trait>`
49 error: aborting due to 3 previous errors
51 For more information about this error, try `rustc --explain E0038`.