1 error: any use of this value will cause an error
2 --> $DIR/erroneous_const2.rs:LL:CC
4 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5 | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
7 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
9 = note: `#[deny(const_err)]` on by default
11 error[E0080]: evaluation of constant value failed
12 --> $DIR/erroneous_const2.rs:LL:CC
14 LL | println!("{}", FOO);
15 | ^^^ referenced constant has errors
17 error: erroneous constant used
18 --> $DIR/erroneous_const2.rs:LL:CC
20 LL | println!("{}", FOO);
21 | ^^^ referenced constant has errors
23 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
25 = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
27 error: post-monomorphization error: referenced constant has errors
28 --> $DIR/erroneous_const2.rs:LL:CC
30 LL | println!("{}", FOO);
31 | ^^^ referenced constant has errors
33 = note: inside `main` at $DIR/erroneous_const2.rs:LL:CC
35 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
37 error: aborting due to 4 previous errors
39 For more information about this error, try `rustc --explain E0080`.