-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.
Description
#![feature(associated_consts)]
trait Foo {
const ID: usize;
}
impl Foo for i32 {
const ID: usize = 1;
}
fn main() {
let arr: [i32; i32::ID];
}
https://is.gd/L4Fg4k
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.
tforgione, Lapin0t, kornelski and U007D
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.