|
| 1 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 2 | + --> $DIR/ice-non-last-unsized-field-issue-121473.rs:10:17 |
| 3 | + | |
| 4 | +LL | pub field2: str, // Unsized field that is not the last field |
| 5 | + | ^^^ doesn't have a size known at compile-time |
| 6 | + | |
| 7 | + = help: the trait `Sized` is not implemented for `str` |
| 8 | + = note: only the last field of a struct may have a dynamically sized type |
| 9 | + = help: change the field's type to have a statically known size |
| 10 | +help: borrowed types always have a statically known size |
| 11 | + | |
| 12 | +LL | pub field2: &str, // Unsized field that is not the last field |
| 13 | + | + |
| 14 | +help: the `Box` type always has a statically known size and allocates its contents in the heap |
| 15 | + | |
| 16 | +LL | pub field2: Box<str>, // Unsized field that is not the last field |
| 17 | + | ++++ + |
| 18 | + |
| 19 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 20 | + --> $DIR/ice-non-last-unsized-field-issue-121473.rs:18:17 |
| 21 | + | |
| 22 | +LL | field2: str, // Unsized |
| 23 | + | ^^^ doesn't have a size known at compile-time |
| 24 | + | |
| 25 | + = help: the trait `Sized` is not implemented for `str` |
| 26 | + = note: no field of an enum variant may have a dynamically sized type |
| 27 | + = help: change the field's type to have a statically known size |
| 28 | +help: borrowed types always have a statically known size |
| 29 | + | |
| 30 | +LL | field2: &str, // Unsized |
| 31 | + | + |
| 32 | +help: the `Box` type always has a statically known size and allocates its contents in the heap |
| 33 | + | |
| 34 | +LL | field2: Box<str>, // Unsized |
| 35 | + | ++++ + |
| 36 | + |
| 37 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 38 | + --> $DIR/ice-non-last-unsized-field-issue-121473.rs:27:9 |
| 39 | + | |
| 40 | +LL | str, // Unsized |
| 41 | + | ^^^ doesn't have a size known at compile-time |
| 42 | + | |
| 43 | + = help: the trait `Sized` is not implemented for `str` |
| 44 | + = note: no field of an enum variant may have a dynamically sized type |
| 45 | + = help: change the field's type to have a statically known size |
| 46 | +help: borrowed types always have a statically known size |
| 47 | + | |
| 48 | +LL | &str, // Unsized |
| 49 | + | + |
| 50 | +help: the `Box` type always has a statically known size and allocates its contents in the heap |
| 51 | + | |
| 52 | +LL | Box<str>, // Unsized |
| 53 | + | ++++ + |
| 54 | + |
| 55 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 56 | + --> $DIR/ice-non-last-unsized-field-issue-121473.rs:35:13 |
| 57 | + | |
| 58 | +LL | field2: str, // Unsized |
| 59 | + | ^^^ doesn't have a size known at compile-time |
| 60 | + | |
| 61 | + = help: the trait `Sized` is not implemented for `str` |
| 62 | + = note: no field of a union may have a dynamically sized type |
| 63 | + = help: change the field's type to have a statically known size |
| 64 | +help: borrowed types always have a statically known size |
| 65 | + | |
| 66 | +LL | field2: &str, // Unsized |
| 67 | + | + |
| 68 | +help: the `Box` type always has a statically known size and allocates its contents in the heap |
| 69 | + | |
| 70 | +LL | field2: Box<str>, // Unsized |
| 71 | + | ++++ + |
| 72 | + |
| 73 | +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union |
| 74 | + --> $DIR/ice-non-last-unsized-field-issue-121473.rs:35:5 |
| 75 | + | |
| 76 | +LL | field2: str, // Unsized |
| 77 | + | ^^^^^^^^^^^ |
| 78 | + | |
| 79 | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` |
| 80 | +help: wrap the field type in `ManuallyDrop<...>` |
| 81 | + | |
| 82 | +LL | field2: std::mem::ManuallyDrop<str>, // Unsized |
| 83 | + | +++++++++++++++++++++++ + |
| 84 | + |
| 85 | +error: aborting due to 5 previous errors |
| 86 | + |
| 87 | +Some errors have detailed explanations: E0277, E0740. |
| 88 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments