2018-08-26 15:19:34 +02:00
|
|
|
warning: any use of this value will cause an error
|
2019-12-14 04:28:32 +01:00
|
|
|
--> $DIR/conditional_array_execution.rs:7: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];
|
2019-03-10 17:28:52 -07:00
|
|
|
| ------------------^^^^^---------------------------
|
2018-06-27 13:36:30 +02:00
|
|
|
| |
|
2020-09-15 20:34:50 +01:00
|
|
|
| attempt to compute `5_u32 - 6_u32`, which would overflow
|
2018-03-06 12:43:02 +01:00
|
|
|
|
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2019-12-14 04:28:32 +01:00
|
|
|
--> $DIR/conditional_array_execution.rs:3:9
|
2018-05-11 14:33:37 +02:00
|
|
|
|
|
|
|
|
LL | #![warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
2021-01-30 14:49:22 +01:00
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
2018-01-25 14:15:12 +01:00
|
|
|
|
2021-01-24 12:50:30 +01:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2021-01-30 14:49:22 +01:00
|
|
|
--> $DIR/conditional_array_execution.rs:12:20
|
2018-06-03 02:04:20 +02:00
|
|
|
|
|
|
|
|
LL | println!("{}", FOO);
|
|
|
|
| ^^^ referenced constant has errors
|
|
|
|
|
2020-01-08 21:31:08 +01:00
|
|
|
warning: erroneous constant used
|
2021-01-30 14:49:22 +01:00
|
|
|
--> $DIR/conditional_array_execution.rs:12:20
|
2019-11-22 17:26:09 -03:00
|
|
|
|
|
|
|
|
LL | println!("{}", FOO);
|
|
|
|
| ^^^ referenced constant has errors
|
2021-01-30 14:49:22 +01:00
|
|
|
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
2021-10-21 09:01:16 -05:00
|
|
|
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2019-11-22 17:26:09 -03:00
|
|
|
|
2020-03-11 16:30:09 +01:00
|
|
|
error: aborting due to previous error; 2 warnings emitted
|
2018-06-03 02:04:20 +02:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0080`.
|