1 error[E0493]: destructor of `SafeStruct` cannot be evaluated at compile-time
2 --> $DIR/check-static-values-constraints.rs:65:43
4 LL | ..SafeStruct{field1: SafeEnum::Variant3(WithDtor),
5 | ___________________________________________^
7 LL | | field2: SafeEnum::Variant1}};
8 | | ^- value is dropped here
9 | |________________________________________________________________________________|
10 | the destructor for this type cannot be evaluated in statics
12 error[E0010]: allocations are not allowed in statics
13 --> $DIR/check-static-values-constraints.rs:79:33
15 LL | static STATIC11: Box<MyOwned> = box MyOwned;
16 | ^^^^^^^^^^^ allocation not allowed in statics
18 error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
19 --> $DIR/check-static-values-constraints.rs:89:38
21 LL | field2: SafeEnum::Variant4("str".to_string())
24 = note: calls in statics are limited to constant functions, tuple structs and tuple variants
25 = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
27 error[E0010]: allocations are not allowed in statics
28 --> $DIR/check-static-values-constraints.rs:94:5
31 | ^^^^^^^^^^^ allocation not allowed in statics
33 error[E0010]: allocations are not allowed in statics
34 --> $DIR/check-static-values-constraints.rs:95:5
37 | ^^^^^^^^^^^ allocation not allowed in statics
39 error[E0010]: allocations are not allowed in statics
40 --> $DIR/check-static-values-constraints.rs:99:6
43 | ^^^^^^^^^^^ allocation not allowed in statics
45 error[E0010]: allocations are not allowed in statics
46 --> $DIR/check-static-values-constraints.rs:100:6
49 | ^^^^^^^^^^^ allocation not allowed in statics
51 error[E0010]: allocations are not allowed in statics
52 --> $DIR/check-static-values-constraints.rs:106:5
55 | ^^^^^ allocation not allowed in statics
57 error[E0507]: cannot move out of static item `x`
58 --> $DIR/check-static-values-constraints.rs:110:45
60 LL | let y = { static x: Box<isize> = box 3; x };
63 | move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait
64 | help: consider borrowing here: `&x`
66 error[E0010]: allocations are not allowed in statics
67 --> $DIR/check-static-values-constraints.rs:110:38
69 LL | let y = { static x: Box<isize> = box 3; x };
70 | ^^^^^ allocation not allowed in statics
72 error: aborting due to 10 previous errors
74 Some errors have detailed explanations: E0010, E0015, E0493, E0507.
75 For more information about an error, try `rustc --explain E0010`.