2018-03-06 12:43:02 +01:00
|
|
|
warning: attempt to subtract with overflow
|
2018-05-11 14:33:37 +02:00
|
|
|
--> $DIR/conditional_array_execution.rs:16:19
|
2018-01-25 14:15:12 +01:00
|
|
|
|
|
2018-03-06 12:43:02 +01:00
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2018-05-11 14:33:37 +02:00
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/conditional_array_execution.rs:12:9
|
|
|
|
|
|
|
|
|
LL | #![warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
2018-01-25 14:15:12 +01:00
|
|
|
|
2018-04-20 14:18:29 +02:00
|
|
|
warning: this constant cannot be used
|
2018-05-11 14:33:37 +02:00
|
|
|
--> $DIR/conditional_array_execution.rs:16:1
|
2018-04-20 14:18:29 +02:00
|
|
|
|
|
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
2018-06-02 23:38:57 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| attempt to subtract with overflow
|
2018-04-20 14:18:29 +02:00
|
|
|
|
2018-06-02 23:38:57 +02:00
|
|
|
warning: this expression will panic at runtime
|
2018-05-11 14:33:37 +02:00
|
|
|
--> $DIR/conditional_array_execution.rs:21:20
|
2018-01-25 14:15:12 +01:00
|
|
|
|
|
2018-04-08 22:26:28 +02:00
|
|
|
LL | println!("{}", FOO);
|
2018-03-06 12:43:02 +01:00
|
|
|
| ^^^ referenced constant has errors
|
2018-01-25 14:15:12 +01:00
|
|
|
|