1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/check-static-values-constraints.rs:65:43
|
LL | ..SafeStruct{field1: SafeEnum::Variant3(WithDtor),
| ___________________________________________^
LL | |
LL | | field2: SafeEnum::Variant1}};
| |________________________________________________________________________________^ statics cannot evaluate destructors
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:79:33
|
LL | static STATIC11: Box<MyOwned> = box MyOwned;
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:79:37
|
LL | static STATIC11: Box<MyOwned> = box MyOwned;
| ^^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
--> $DIR/check-static-values-constraints.rs:90:32
|
LL | field2: SafeEnum::Variant4("str".to_string())
| ^^^^^^^^^^^^^^^^^
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:95:5
|
LL | box MyOwned,
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:95:9
|
LL | box MyOwned,
| ^^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:97:5
|
LL | box MyOwned,
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:97:9
|
LL | box MyOwned,
| ^^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:102:6
|
LL | &box MyOwned,
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:102:10
|
LL | &box MyOwned,
| ^^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:104:6
|
LL | &box MyOwned,
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:104:10
|
LL | &box MyOwned,
| ^^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:111:5
|
LL | box 3;
| ^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:111:9
|
LL | box 3;
| ^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0507]: cannot move out of static item `x`
--> $DIR/check-static-values-constraints.rs:116:45
|
LL | let y = { static x: Box<isize> = box 3; x };
| ^
| |
| move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
| help: consider borrowing here: `&x`
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:116:38
|
LL | let y = { static x: Box<isize> = box 3; x };
| ^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:116:42
|
LL | let y = { static x: Box<isize> = box 3; x };
| ^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error: aborting due to 17 previous errors
Some errors have detailed explanations: E0010, E0015, E0019, E0493, E0507.
For more information about an error, try `rustc --explain E0010`.
|