]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0010.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / 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 ```