]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0277]: the size for values of type `str` cannot be known at compilation time |
064997fb | 2 | --> $DIR/union-unsized.rs:5:8 |
b7449926 XL |
3 | | |
4 | LL | a: str, | |
3dfed10e | 5 | | ^^^ doesn't have a size known at compile-time |
b7449926 | 6 | | |
1b1a35ee | 7 | = help: the trait `Sized` is not implemented for `str` |
b7449926 | 8 | = note: no field of a union may have a dynamically sized type |
3dfed10e XL |
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 | a: &str, | |
94222f64 | 13 | | + |
3dfed10e XL |
14 | help: the `Box` type always has a statically known size and allocates its contents in the heap |
15 | | | |
16 | LL | a: Box<str>, | |
94222f64 | 17 | | ++++ + |
b7449926 XL |
18 | |
19 | error[E0277]: the size for values of type `str` cannot be known at compilation time | |
064997fb | 20 | --> $DIR/union-unsized.rs:13:8 |
b7449926 XL |
21 | | |
22 | LL | b: str, | |
3dfed10e | 23 | | ^^^ doesn't have a size known at compile-time |
b7449926 | 24 | | |
1b1a35ee | 25 | = help: the trait `Sized` is not implemented for `str` |
b7449926 | 26 | = note: no field of a union may have a dynamically sized type |
3dfed10e XL |
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 | b: &str, | |
94222f64 | 31 | | + |
3dfed10e XL |
32 | help: the `Box` type always has a statically known size and allocates its contents in the heap |
33 | | | |
34 | LL | b: Box<str>, | |
94222f64 | 35 | | ++++ + |
b7449926 XL |
36 | |
37 | error: aborting due to 2 previous errors | |
38 | ||
39 | For more information about this error, try `rustc --explain E0277`. |