1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2 --> $DIR/union-sized-field.rs:4:12
4 LL | union Foo<T: ?Sized> {
5 | - this type parameter needs to be `std::marker::Sized`
7 | ^ doesn't have a size known at compile-time
9 = help: the trait `std::marker::Sized` is not implemented for `T`
10 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
11 = note: no field of a union may have a dynamically sized type
12 = help: change the field's type to have a statically known size
13 help: borrowed types always have a statically known size
17 help: heap allocated types always have a statically known size
22 error[E0277]: the size for values of type `T` cannot be known at compilation time
23 --> $DIR/union-sized-field.rs:9:12
25 LL | struct Foo2<T: ?Sized> {
26 | - this type parameter needs to be `std::marker::Sized`
28 | ^ doesn't have a size known at compile-time
30 = help: the trait `std::marker::Sized` is not implemented for `T`
31 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
32 = note: only the last field of a struct may have a dynamically sized type
33 = help: change the field's type to have a statically known size
34 help: borrowed types always have a statically known size
38 help: heap allocated types always have a statically known size
43 error[E0277]: the size for values of type `T` cannot be known at compilation time
44 --> $DIR/union-sized-field.rs:15:11
46 LL | enum Foo3<T: ?Sized> {
47 | - this type parameter needs to be `std::marker::Sized`
49 | ^ doesn't have a size known at compile-time
51 = help: the trait `std::marker::Sized` is not implemented for `T`
52 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
53 = note: no field of an enum variant may have a dynamically sized type
54 = help: change the field's type to have a statically known size
55 help: borrowed types always have a statically known size
59 help: heap allocated types always have a statically known size
64 error: aborting due to 3 previous errors
66 For more information about this error, try `rustc --explain E0277`.