blob: 88d3bb5810fe25638452ddc7ac56d9f4d9eac93f [file] [edit]
error[E0038]: the trait `Sized` is not dyn compatible
--> $DIR/sized-3.rs:8:47
|
LL | fn unsize_sized<T: 'static>(x: Box<T>) -> Box<dyn Sized> {
| ^^^^^^^^^ `Sized` is not dyn compatible
|
= note: the trait is not dyn compatible because it requires `Self: Sized`
= note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
error[E0038]: the trait `Foo` is not dyn compatible
--> $DIR/sized-3.rs:13:27
|
LL | fn unsize_subtrait(x: Box<dyn Foo>) -> Box<dyn Sized> {
| ^^^^^^^ `Foo` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/sized-3.rs:4:30
|
LL | trait Foo: std::fmt::Debug + Sized {}
| --- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait is not dyn compatible...
error[E0038]: the trait `Sized` is not dyn compatible
--> $DIR/sized-3.rs:13:44
|
LL | fn unsize_subtrait(x: Box<dyn Foo>) -> Box<dyn Sized> {
| ^^^^^^^^^ `Sized` is not dyn compatible
|
= note: the trait is not dyn compatible because it requires `Self: Sized`
= note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
error[E0038]: the trait `Sized` is not dyn compatible
--> $DIR/sized-3.rs:20:15
|
LL | let _bx = unsize_sized(Box::new(vec![1, 2, 3]));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Sized` is not dyn compatible
|
= note: the trait is not dyn compatible because it requires `Self: Sized`
= note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
error[E0038]: the trait `Foo` is not dyn compatible
--> $DIR/sized-3.rs:23:21
|
LL | let bx: Box<dyn Foo> = Box::new(vec![1, 2, 3]);
| ^^^ `Foo` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/sized-3.rs:4:30
|
LL | trait Foo: std::fmt::Debug + Sized {}
| --- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait is not dyn compatible...
error[E0038]: the trait `Foo` is not dyn compatible
--> $DIR/sized-3.rs:26:31
|
LL | let _bx = unsize_subtrait(bx);
| ^^ `Foo` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/sized-3.rs:4:30
|
LL | trait Foo: std::fmt::Debug + Sized {}
| --- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait is not dyn compatible...
error[E0038]: the trait `Sized` is not dyn compatible
--> $DIR/sized-3.rs:26:15
|
LL | let _bx = unsize_subtrait(bx);
| ^^^^^^^^^^^^^^^^^^^ `Sized` is not dyn compatible
|
= note: the trait is not dyn compatible because it requires `Self: Sized`
= note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0038`.