blob: df8efc44c4966fdb4885b31555d40fb6efc5db36 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
warning: any use of this value will cause an error
--> $DIR/conditional_array_execution.rs:7:19
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
| ------------------^^^^^---------------------------
| |
| attempt to subtract with overflow
|
note: the lint level is defined here
--> $DIR/conditional_array_execution.rs:3:9
|
LL | #![warn(const_err)]
| ^^^^^^^^^
error[E0080]: evaluation of constant expression failed
--> $DIR/conditional_array_execution.rs:11:20
|
LL | println!("{}", FOO);
| ^^^ referenced constant has errors
warning: erroneous constant used
--> $DIR/conditional_array_execution.rs:11:20
|
LL | println!("{}", FOO);
| ^^^ referenced constant has errors
error: aborting due to previous error; 2 warnings emitted
For more information about this error, try `rustc --explain E0080`.
|