1 A non-constant value was used in a constant expression.
3 Erroneous code example:
7 let a: [u8; foo]; // error: attempt to use a non-constant value in a constant
10 'constant' means 'a compile-time value'.
12 More details can be found in the [Variables and Mutability] section of the book.
14 [Variables and Mutability]: https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants
16 To fix this error, please replace the value with a constant. Example:
19 let a: [u8; 42]; // ok!
25 const FOO: usize = 42;
26 let a: [u8; FOO]; // ok!