]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0277]: the size for values of type `T` cannot be known at compilation time |
3dfed10e | 2 | --> $DIR/union-sized-field.rs:4:12 |
3b2f2976 | 3 | | |
e74abb32 | 4 | LL | union Foo<T: ?Sized> { |
cdc7bbd5 | 5 | | - this type parameter needs to be `std::marker::Sized` |
064997fb FG |
6 | LL | value: ManuallyDrop<T>, |
7 | | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | |
3b2f2976 | 8 | | |
064997fb | 9 | = note: required because it appears within the type `ManuallyDrop<T>` |
3b2f2976 | 10 | = note: no field of a union may have a dynamically sized type |
3dfed10e | 11 | = help: change the field's type to have a statically known size |
94222f64 XL |
12 | help: consider removing the `?Sized` bound to make the type parameter `Sized` |
13 | | | |
14 | LL - union Foo<T: ?Sized> { | |
15 | LL + union Foo<T> { | |
923072b8 | 16 | | |
3dfed10e XL |
17 | help: borrowed types always have a statically known size |
18 | | | |
064997fb | 19 | LL | value: &ManuallyDrop<T>, |
94222f64 | 20 | | + |
3dfed10e XL |
21 | help: the `Box` type always has a statically known size and allocates its contents in the heap |
22 | | | |
064997fb FG |
23 | LL | value: Box<ManuallyDrop<T>>, |
24 | | ++++ + | |
3b2f2976 | 25 | |
8faf50e0 | 26 | error[E0277]: the size for values of type `T` cannot be known at compilation time |
3dfed10e | 27 | --> $DIR/union-sized-field.rs:9:12 |
3b2f2976 | 28 | | |
e74abb32 | 29 | LL | struct Foo2<T: ?Sized> { |
cdc7bbd5 | 30 | | - this type parameter needs to be `std::marker::Sized` |
064997fb FG |
31 | LL | value: ManuallyDrop<T>, |
32 | | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | |
3b2f2976 | 33 | | |
064997fb | 34 | = note: required because it appears within the type `ManuallyDrop<T>` |
3b2f2976 | 35 | = note: only the last field of a struct may have a dynamically sized type |
3dfed10e | 36 | = help: change the field's type to have a statically known size |
94222f64 XL |
37 | help: consider removing the `?Sized` bound to make the type parameter `Sized` |
38 | | | |
39 | LL - struct Foo2<T: ?Sized> { | |
40 | LL + struct Foo2<T> { | |
923072b8 | 41 | | |
3dfed10e XL |
42 | help: borrowed types always have a statically known size |
43 | | | |
064997fb | 44 | LL | value: &ManuallyDrop<T>, |
94222f64 | 45 | | + |
3dfed10e XL |
46 | help: the `Box` type always has a statically known size and allocates its contents in the heap |
47 | | | |
064997fb FG |
48 | LL | value: Box<ManuallyDrop<T>>, |
49 | | ++++ + | |
3b2f2976 | 50 | |
8faf50e0 | 51 | error[E0277]: the size for values of type `T` cannot be known at compilation time |
0731742a | 52 | --> $DIR/union-sized-field.rs:15:11 |
3b2f2976 | 53 | | |
e74abb32 | 54 | LL | enum Foo3<T: ?Sized> { |
cdc7bbd5 | 55 | | - this type parameter needs to be `std::marker::Sized` |
064997fb FG |
56 | LL | Value(ManuallyDrop<T>), |
57 | | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | |
3b2f2976 | 58 | | |
064997fb | 59 | = note: required because it appears within the type `ManuallyDrop<T>` |
3b2f2976 | 60 | = note: no field of an enum variant may have a dynamically sized type |
3dfed10e | 61 | = help: change the field's type to have a statically known size |
94222f64 XL |
62 | help: consider removing the `?Sized` bound to make the type parameter `Sized` |
63 | | | |
64 | LL - enum Foo3<T: ?Sized> { | |
65 | LL + enum Foo3<T> { | |
923072b8 | 66 | | |
3dfed10e XL |
67 | help: borrowed types always have a statically known size |
68 | | | |
064997fb | 69 | LL | Value(&ManuallyDrop<T>), |
94222f64 | 70 | | + |
3dfed10e XL |
71 | help: the `Box` type always has a statically known size and allocates its contents in the heap |
72 | | | |
064997fb FG |
73 | LL | Value(Box<ManuallyDrop<T>>), |
74 | | ++++ + | |
3b2f2976 XL |
75 | |
76 | error: aborting due to 3 previous errors | |
77 | ||
0531ce1d | 78 | For more information about this error, try `rustc --explain E0277`. |