]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/conditional_array_execution.stderr
Rollup merge of #80733 - steffahn:prettify_pin_links, r=jyn514
[rust.git] / src / test / ui / consts / const-eval / conditional_array_execution.stderr
1 warning: any use of this value will cause an error
2   --> $DIR/conditional_array_execution.rs:7:19
3    |
4 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5    | ------------------^^^^^---------------------------
6    |                   |
7    |                   attempt to compute `5_u32 - 6_u32`, which would overflow
8    |
9 note: the lint level is defined here
10   --> $DIR/conditional_array_execution.rs:3:9
11    |
12 LL | #![warn(const_err)]
13    |         ^^^^^^^^^
14    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
15    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
16
17 error[E0080]: evaluation of constant value failed
18   --> $DIR/conditional_array_execution.rs:12:20
19    |
20 LL |     println!("{}", FOO);
21    |                    ^^^ referenced constant has errors
22
23 warning: erroneous constant used
24   --> $DIR/conditional_array_execution.rs:12:20
25    |
26 LL |     println!("{}", FOO);
27    |                    ^^^ referenced constant has errors
28    |
29    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
30    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
31
32 error: aborting due to previous error; 2 warnings emitted
33
34 For more information about this error, try `rustc --explain E0080`.