Skip to content

Commit 95ad630

Browse files
committed
Add error explanation for E0010
1 parent 551a74d commit 95ad630

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc/diagnostics.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ match x {
168168
```
169169
"##,
170170

171+
E0010: r##"
172+
The value of statics and constants must be known at compile time, and they live
173+
for the entire lifetime of a program. Creating a boxed value allocates memory on
174+
the heap at runtime, and therefore cannot be done at compile time.
175+
"##,
176+
171177
E0013: r##"
172178
Static and const variables can refer to other const variables. But a const
173179
variable cannot refer to a static variable. For example, `Y` cannot refer to `X`
@@ -478,7 +484,6 @@ a compile-time constant.
478484
}
479485

480486
register_diagnostics! {
481-
E0010,
482487
E0011,
483488
E0012,
484489
E0014,

0 commit comments

Comments
 (0)