1 warning: any use of this value will cause an error
2 --> $DIR/issue-43197.rs:10:20
4 LL | const X: u32 = 0 - 1;
5 | ---------------^^^^^-
7 | attempt to compute `0_u32 - 1_u32`, which would overflow
9 note: the lint level is defined here
10 --> $DIR/issue-43197.rs:3:9
12 LL | #![warn(const_err)]
15 warning: any use of this value will cause an error
16 --> $DIR/issue-43197.rs:12:24
18 LL | const Y: u32 = foo(0 - 1);
19 | -------------------^^^^^--
21 | attempt to compute `0_u32 - 1_u32`, which would overflow
23 error[E0080]: evaluation of constant expression failed
24 --> $DIR/issue-43197.rs:14:23
26 LL | println!("{} {}", X, Y);
27 | ^ referenced constant has errors
29 warning: erroneous constant used
30 --> $DIR/issue-43197.rs:14:23
32 LL | println!("{} {}", X, Y);
33 | ^ referenced constant has errors
35 error[E0080]: evaluation of constant expression failed
36 --> $DIR/issue-43197.rs:14:26
38 LL | println!("{} {}", X, Y);
39 | ^ referenced constant has errors
41 warning: erroneous constant used
42 --> $DIR/issue-43197.rs:14:26
44 LL | println!("{} {}", X, Y);
45 | ^ referenced constant has errors
47 error: aborting due to 2 previous errors; 4 warnings emitted
49 For more information about this error, try `rustc --explain E0080`.