]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/erroneous_const2.rs
Rollup merge of #101717 - Pointerbender:unsafecell-memory-layout, r=Amanieu
[rust.git] / src / tools / miri / tests / fail / erroneous_const2.rs
1 const X: u32 = 5;
2 const Y: u32 = 6;
3 const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
4 //~^ERROR: evaluation of constant value failed
5
6 #[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
7 fn main() {
8     println!("{}", FOO);
9 }