Closed
Description
https://doc.rust-lang.org/book/associated-constants.html
#![feature(associated_consts)]
trait Foo {
const ID: usize;
}
impl Foo for i32 {
const ID: usize = 1;
}
fn main() {
let arr: [i32; i32::ID];
}
array length constant evaluation error: non-constant path in constant expression
I had a quick look at the rfc but I couldn't find out if it should be legal to use associated-constants in constant expressions.