summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0010.md
blob: f03f8a6605f664d82b6d695d29261eb494ef060a (plain)
1
2
3
4
5
6
7
8
9
The value of statics and constants must be known at compile time, and they live
for the entire lifetime of a program. Creating a boxed value allocates memory on
the heap at runtime, and therefore cannot be done at compile time.

Erroneous code example:

```compile_fail,E0010
const CON : Vec<i32> = vec![1, 2, 3];
```