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 `Sized`
7 | ^ doesn't have a size known at compile-time
9 = note: no field of a union may have a dynamically sized type
10 = help: change the field's type to have a statically known size
11 help: borrowed types always have a statically known size
15 help: the `Box` type always has a statically known size and allocates its contents in the heap
20 error[E0277]: the size for values of type `T` cannot be known at compilation time
21 --> $DIR/union-sized-field.rs:9:12
23 LL | struct Foo2<T: ?Sized> {
24 | - this type parameter needs to be `Sized`
26 | ^ doesn't have a size known at compile-time
28 = note: only the last field of a struct may have a dynamically sized type
29 = help: change the field's type to have a statically known size
30 help: borrowed types always have a statically known size
34 help: the `Box` type always has a statically known size and allocates its contents in the heap
39 error[E0277]: the size for values of type `T` cannot be known at compilation time
40 --> $DIR/union-sized-field.rs:15:11
42 LL | enum Foo3<T: ?Sized> {
43 | - this type parameter needs to be `Sized`
45 | ^ doesn't have a size known at compile-time
47 = note: no field of an enum variant may have a dynamically sized type
48 = help: change the field's type to have a statically known size
49 help: borrowed types always have a statically known size
53 help: the `Box` type always has a statically known size and allocates its contents in the heap
58 error: aborting due to 3 previous errors
60 For more information about this error, try `rustc --explain E0277`.