let arr0 = [0u8; 15];
let arr1 = [0u8; arr0.len()]; // this fails
I think the compiler should be able to determine the length of arr0 as a compile time constant, no? Still this is flagged as error saying that variable found instead of constant integer.
- Why?
- Is there constexpr (C++) function in Rust?
Version:
rustc 1.0.0-nightly (ecf8c64e1 2015-03-21) (built 2015-03-22)