]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/conditional_array_execution.stderr
Auto merge of #68601 - 0dvictor:split, r=tmandry
[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 subtract with 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
15 error[E0080]: evaluation of constant expression failed
16   --> $DIR/conditional_array_execution.rs:11:20
17    |
18 LL |     println!("{}", FOO);
19    |                    ^^^ referenced constant has errors
20
21 warning: erroneous constant used
22   --> $DIR/conditional_array_execution.rs:11:20
23    |
24 LL |     println!("{}", FOO);
25    |                    ^^^ referenced constant has errors
26
27 error: aborting due to previous error
28
29 For more information about this error, try `rustc --explain E0080`.