A non-constant value was used in a constant expression.

Erroneous code example:

let foo = 42;
let a: [u8; foo]; // error: attempt to use a non-constant value in a constant

To fix this error, please replace the value with a constant. Example:

let a: [u8; 42]; // ok!

Or:

const FOO: usize = 42;
let a: [u8; FOO]; // ok!