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

36 lines
1.1 KiB
Plaintext
Raw Normal View History

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