rust/src/test/ui/consts/const-eval/conditional_array_execution.stderr

33 lines
991 B
Plaintext
Raw Normal View History

warning: this constant cannot be used
--> $DIR/conditional_array_execution.rs:15:1
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
| ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| attempt to subtract with overflow
|
note: lint level defined here
--> $DIR/conditional_array_execution.rs:11:9
|
LL | #![warn(const_err)]
| ^^^^^^^^^
error[E0080]: referenced constant has errors
--> $DIR/conditional_array_execution.rs:19:20
2018-06-03 01:01:06 +00:00
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
| ----- attempt to subtract with overflow
...
LL | println!("{}", FOO);
| ^^^
error[E0080]: erroneous constant used
--> $DIR/conditional_array_execution.rs:19:20
|
LL | println!("{}", FOO);
| ^^^ referenced constant has errors
2018-06-03 01:01:06 +00:00
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.