fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1warning: any use of this value will cause an error 2 --> $DIR/conditional_array_execution.rs:7:19 3 | 4LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; 5 | ------------------^^^^^--------------------------- 6 | | 7 | attempt to subtract with overflow 8 | 9note: the lint level is defined here 10 --> $DIR/conditional_array_execution.rs:3:9 11 | 12LL | #![warn(const_err)] 13 | ^^^^^^^^^ 14 15error[E0080]: evaluation of constant expression failed 16 --> $DIR/conditional_array_execution.rs:11:20 17 | 18LL | println!("{}", FOO); 19 | ^^^ referenced constant has errors 20 21warning: erroneous constant used 22 --> $DIR/conditional_array_execution.rs:11:20 23 | 24LL | println!("{}", FOO); 25 | ^^^ referenced constant has errors 26 27error: aborting due to previous error; 2 warnings emitted 28 29For more information about this error, try `rustc --explain E0080`.