2018-08-26 13:19:34 +00:00
|
|
|
warning: any use of this value will cause an error
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:5:1
|
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];
|
2018-06-27 11:36:30 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| attempt to subtract with overflow
|
2018-03-06 11:43:02 +00:00
|
|
|
|
|
2018-05-11 12:33:37 +00:00
|
|
|
note: lint level defined here
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:1:9
|
2018-05-11 12:33:37 +00:00
|
|
|
|
|
|
|
|
LL | #![warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
2018-01-25 13:15:12 +00:00
|
|
|
|
2018-08-26 13:19:34 +00:00
|
|
|
error[E0080]: evaluation of constant expression failed
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:9:20
|
2018-06-03 00:04:20 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", FOO);
|
|
|
|
| ^^^ referenced constant has errors
|
|
|
|
|
2018-08-26 13:19:34 +00:00
|
|
|
error: aborting due to previous error
|
2018-06-03 00:04:20 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0080`.
|