summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/conditional_array_execution.rs
blob: 27d5383d6d47f342560d4c5d4857916a8fdadd2b (plain)
1
2
3
4
5
6
7
8
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);
}