1
Fork 0
rust/src/test/ui/const-eval/conditional_array_execution.stderr

25 lines
732 B
Text
Raw Normal View History

warning: attempt to subtract with overflow
--> $DIR/conditional_array_execution.rs:16:19
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
| ^^^^^
|
note: lint level defined here
--> $DIR/conditional_array_execution.rs:12:9
|
LL | #![warn(const_err)]
| ^^^^^^^^^
2018-04-20 14:18:29 +02:00
warning: this constant cannot be used
--> $DIR/conditional_array_execution.rs:16:1
2018-04-20 14:18:29 +02:00
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
warning: constant evaluation error
--> $DIR/conditional_array_execution.rs:21:20
|
LL | println!("{}", FOO);
| ^^^ referenced constant has errors