]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0010.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0010.md
1 The value of statics and constants must be known at compile time, and they live
2 for the entire lifetime of a program. Creating a boxed value allocates memory on
3 the heap at runtime, and therefore cannot be done at compile time.
4
5 Erroneous code example:
6
7 ```compile_fail,E0010
8 #![feature(box_syntax)]
9
10 const CON : Box<i32> = box 0;
11 ```