Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 318 Bytes

File metadata and controls

9 lines (7 loc) · 318 Bytes

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:

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