2018-03-06 11:43:02 +00:00
|
|
|
warning: attempt to subtract with overflow
|
2018-06-03 00:04:20 +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];
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2018-05-11 12:33:37 +00:00
|
|
|
note: lint level defined here
|
2018-06-03 00:04:20 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:11:9
|
2018-05-11 12:33:37 +00:00
|
|
|
|
|
|
|
|
LL | #![warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
2018-01-25 13:15:12 +00:00
|
|
|
|
2018-04-20 12:18:29 +00:00
|
|
|
warning: this constant cannot be used
|
2018-06-03 00:04:20 +00:00
|
|
|
--> $DIR/conditional_array_execution.rs:15:1
|
2018-04-20 12:18:29 +00:00
|
|
|
|
|
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
2018-06-02 21:38:57 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| attempt to subtract with overflow
|
2018-04-20 12:18:29 +00:00
|
|
|
|
2018-06-03 01:01:06 +00:00
|
|
|
warning: referenced constant
|
|
|
|
--> $DIR/conditional_array_execution.rs:20:20
|
|
|
|
|
|
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
|
|
|
| ----- attempt to subtract with overflow
|
|
|
|
...
|
|
|
|
LL | println!("{}", FOO);
|
|
|
|
| ^^^
|
|
|
|
|
2018-06-02 21:38:57 +00:00
|
|
|
warning: this expression will panic at runtime
|
2018-06-03 00:04:20 +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
|
|
|
|
2018-06-03 01:01:06 +00:00
|
|
|
error[E0080]: referenced constant
|
|
|
|
--> $DIR/conditional_array_execution.rs:20:20
|
|
|
|
|
|
|
|
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
|
|
|
| ----- attempt to subtract with overflow
|
|
|
|
...
|
|
|
|
LL | println!("{}", FOO);
|
|
|
|
| ^^^
|
|
|
|
|
2018-06-03 00:04:20 +00:00
|
|
|
error[E0080]: erroneous constant used
|
|
|
|
--> $DIR/conditional_array_execution.rs:20:20
|
|
|
|
|
|
|
|
|
LL | println!("{}", FOO);
|
|
|
|
| ^^^ referenced constant has errors
|
|
|
|
|
2018-06-03 01:01:06 +00:00
|
|
|
error: aborting due to 2 previous errors
|
2018-06-03 00:04:20 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0080`.
|