@@ -11,12 +11,14 @@ LL | | }
11
11
LL | };
12
12
| - value is dropped here
13
13
14
- error[E0010 ]: allocations are not allowed in statics
14
+ error[E0015 ]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
15
15
--> $DIR/check-values-constraints.rs:81:33
16
16
|
17
17
LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
18
- | ^^^^^^^^^^^^^ allocation not allowed in statics
18
+ | ^^^^^^^^^^^^^
19
19
|
20
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
21
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
20
22
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
21
23
22
24
error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
@@ -38,12 +40,14 @@ LL | field2: SafeEnum::Variant4("str".to_string()),
38
40
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
39
41
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
40
42
41
- error[E0010 ]: allocations are not allowed in statics
43
+ error[E0015 ]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
42
44
--> $DIR/check-values-constraints.rs:96:5
43
45
|
44
46
LL | vec![MyOwned],
45
- | ^^^^^^^^^^^^^ allocation not allowed in statics
47
+ | ^^^^^^^^^^^^^
46
48
|
49
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
50
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
47
51
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
48
52
49
53
error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
@@ -56,12 +60,14 @@ LL | vec![MyOwned],
56
60
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
57
61
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
58
62
59
- error[E0010 ]: allocations are not allowed in statics
63
+ error[E0015 ]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
60
64
--> $DIR/check-values-constraints.rs:98:5
61
65
|
62
66
LL | vec![MyOwned],
63
- | ^^^^^^^^^^^^^ allocation not allowed in statics
67
+ | ^^^^^^^^^^^^^
64
68
|
69
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
70
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
65
71
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
66
72
67
73
error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
@@ -74,12 +80,14 @@ LL | vec![MyOwned],
74
80
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
75
81
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
76
82
77
- error[E0010 ]: allocations are not allowed in statics
83
+ error[E0015 ]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
78
84
--> $DIR/check-values-constraints.rs:103:6
79
85
|
80
86
LL | &vec![MyOwned],
81
- | ^^^^^^^^^^^^^ allocation not allowed in statics
87
+ | ^^^^^^^^^^^^^
82
88
|
89
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
90
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
83
91
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
84
92
85
93
error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
@@ -92,12 +100,14 @@ LL | &vec![MyOwned],
92
100
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
93
101
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
94
102
95
- error[E0010 ]: allocations are not allowed in statics
103
+ error[E0015 ]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
96
104
--> $DIR/check-values-constraints.rs:105:6
97
105
|
98
106
LL | &vec![MyOwned],
99
- | ^^^^^^^^^^^^^ allocation not allowed in statics
107
+ | ^^^^^^^^^^^^^
100
108
|
109
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
110
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
101
111
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
102
112
103
113
error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
@@ -110,12 +120,14 @@ LL | &vec![MyOwned],
110
120
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
111
121
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
112
122
113
- error[E0010 ]: allocations are not allowed in statics
123
+ error[E0015 ]: cannot call non-const associated function `Box::<[isize; 1]>::new` in statics
114
124
--> $DIR/check-values-constraints.rs:111:31
115
125
|
116
126
LL | static STATIC19: Vec<isize> = vec![3];
117
- | ^^^^^^^ allocation not allowed in statics
127
+ | ^^^^^^^
118
128
|
129
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
130
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
119
131
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
120
132
121
133
error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
@@ -128,12 +140,14 @@ LL | static STATIC19: Vec<isize> = vec![3];
128
140
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
129
141
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
130
142
131
- error[E0010 ]: allocations are not allowed in statics
143
+ error[E0015 ]: cannot call non-const associated function `Box::<[isize; 1]>::new` in statics
132
144
--> $DIR/check-values-constraints.rs:117:32
133
145
|
134
146
LL | static x: Vec<isize> = vec![3];
135
- | ^^^^^^^ allocation not allowed in statics
147
+ | ^^^^^^^
136
148
|
149
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
150
+ = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
137
151
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
138
152
139
153
error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
@@ -163,5 +177,5 @@ LL | x.clone()
163
177
164
178
error: aborting due to 17 previous errors
165
179
166
- Some errors have detailed explanations: E0010, E0015, E0493, E0507.
167
- For more information about an error, try `rustc --explain E0010 `.
180
+ Some errors have detailed explanations: E0015, E0493, E0507.
181
+ For more information about an error, try `rustc --explain E0015 `.
0 commit comments