mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
9 lines
147 B
Rust
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);
|
|
}
|