2021-01-01 14:47:45 +01:00
|
|
|
warning: any use of this value will cause an error
|
2021-03-31 11:33:15 +00:00
|
|
|
--> $DIR/const-eval-query-stack.rs:20:16
|
2020-08-19 12:05:32 +02:00
|
|
|
|
|
2021-01-01 14:47:45 +01:00
|
|
|
LL | const X: i32 = 1 / 0;
|
|
|
|
| ---------------^^^^^-
|
|
|
|
| |
|
|
|
|
| attempt to divide `1_i32` by zero
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2021-03-31 11:33:15 +00:00
|
|
|
--> $DIR/const-eval-query-stack.rs:19:8
|
2020-08-19 12:05:32 +02:00
|
|
|
|
|
2021-01-01 14:47:45 +01: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>
|
2020-08-19 12:05:32 +02:00
|
|
|
|
2021-01-24 12:50:30 +01:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2021-03-31 11:33:15 +00:00
|
|
|
--> $DIR/const-eval-query-stack.rs:24:28
|
2021-01-01 14:47:45 +01:00
|
|
|
|
|
|
|
|
LL | let x: &'static i32 = &X;
|
2021-01-24 12:50:30 +01:00
|
|
|
| ^ referenced constant has errors
|
2020-08-19 12:05:32 +02:00
|
|
|
query stack during panic:
|
2021-12-05 12:35:49 +01:00
|
|
|
#0 [try_normalize_mir_const_after_erasing_regions] normalizing `main::promoted[1]`
|
2022-03-08 17:20:31 +00:00
|
|
|
#1 [mir_drops_elaborated_and_const_checked] elaborating drops for `main`
|
|
|
|
#2 [optimized_mir] optimizing MIR for `main`
|
|
|
|
#3 [collect_and_partition_mono_items] collect_and_partition_mono_items
|
2020-08-19 12:05:32 +02:00
|
|
|
end of query stack
|