rust/src/test/ui/consts/const-call.rs
2018-12-25 21:08:33 -07:00

9 lines
191 B
Rust

fn f(x: usize) -> usize {
x
}
fn main() {
let _ = [0; f(2)];
//~^ ERROR calls in constants are limited to constant functions
//~| ERROR evaluation of constant value failed
}