rust/tests/ui/consts/const-eval/conditional_array_execution.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
147 B
Rust
Raw Normal View History

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