mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-12 18:07:40 +00:00
27 lines
817 B
Plaintext
27 lines
817 B
Plaintext
![]() |
error[E0080]: constant evaluation error
|
||
|
--> $DIR/conditional_array_execution.rs:13:19
|
||
|
|
|
||
|
13 | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; //~ E0080
|
||
|
| ^^^^^ attempt to subtract with overflow
|
||
|
|
|
||
|
note: inside call to FOO
|
||
|
--> $DIR/conditional_array_execution.rs:13:1
|
||
|
|
|
||
|
13 | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; //~ E0080
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
||
|
error[E0080]: constant evaluation error
|
||
|
--> $DIR/conditional_array_execution.rs:16:20
|
||
|
|
|
||
|
16 | println!("{}", FOO); //~ E0080
|
||
|
| ^^^ attempt to subtract with overflow
|
||
|
|
|
||
|
note: inside call to main
|
||
|
--> $DIR/conditional_array_execution.rs:16:20
|
||
|
|
|
||
|
16 | println!("{}", FOO); //~ E0080
|
||
|
| ^^^
|
||
|
|
||
|
error: aborting due to 2 previous errors
|
||
|
|