2018-03-06 11:43:02 +00:00
|
|
|
warning: attempt to subtract with overflow
|
2018-04-08 20:26:28 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:15:19
|
2018-01-25 13:15:12 +00:00
|
|
|
|
|
2018-03-06 11:43:02 +00:00
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
= note: #[warn(const_err)] on by default
|
2018-01-25 13:15:12 +00:00
|
|
|
|
2018-04-20 12:18:29 +00:00
|
|
|
warning: this constant cannot be used
|
|
|
|
--> $DIR/conditional_array_execution.rs:15:1
|
|
|
|
|
|
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
|
|
|
|
|
2018-04-08 20:26:28 +00:00
|
|
|
warning: constant evaluation error
|
2018-04-20 12:18:29 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:20:20
|
2018-01-25 13:15:12 +00:00
|
|
|
|
|
2018-04-08 20:26:28 +00:00
|
|
|
LL | println!("{}", FOO);
|
2018-03-06 11:43:02 +00:00
|
|
|
| ^^^ referenced constant has errors
|
2018-01-25 13:15:12 +00:00
|
|
|
|