Closed
Description
This code wrongly states "expected constant integer for repeat count, but non-constant path in constant expression"
#![feature(const_fn)]
struct A {
field: usize,
}
const fn f() -> usize {
5
}
fn main() {
let _ = [0; f()];
}
This one works
#![feature(const_fn)]
const fn f() -> usize {
5
}
struct A {
field: usize,
}
fn main() {
let _ = [0; f()];
}
Metadata
Metadata
Assignees
Labels
No labels