about summary refs log tree commit diff
path: root/src/test/ui/const-eval/conditional_array_execution.stderr
blob: 713b1b36c08b1b0c55f807d0eee174608f2e45a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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: #[warn(const_err)] on by default

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

warning: constant evaluation error
  --> $DIR/conditional_array_execution.rs:20:20
   |
LL |     println!("{}", FOO);
   |                    ^^^ referenced constant has errors