rust/tests/ui/consts/const-eval/conditional_array_execution.rs
2023-01-11 09:32:08 +00:00

9 lines
147 B
Rust

const X: u32 = 5;
const Y: u32 = 6;
const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
//~^ ERROR constant
fn main() {
println!("{}", FOO);
}