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)]
14 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
15 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
17 warning: any use of this value will cause an error
18 --> $DIR/issue-43197.rs:13:24
20 LL | const Y: u32 = foo(0 - 1);
21 | -------------------^^^^^--
23 | attempt to compute `0_u32 - 1_u32`, which would overflow
25 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
26 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
28 error[E0080]: evaluation of constant value failed
29 --> $DIR/issue-43197.rs:16:23
31 LL | println!("{} {}", X, Y);
32 | ^ referenced constant has errors
34 warning: erroneous constant used
35 --> $DIR/issue-43197.rs:16:23
37 LL | println!("{} {}", X, Y);
38 | ^ referenced constant has errors
40 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
41 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
43 error[E0080]: evaluation of constant value failed
44 --> $DIR/issue-43197.rs:16:26
46 LL | println!("{} {}", X, Y);
47 | ^ referenced constant has errors
49 warning: erroneous constant used
50 --> $DIR/issue-43197.rs:16:26
52 LL | println!("{} {}", X, Y);
53 | ^ referenced constant has errors
55 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
56 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
58 error: aborting due to 2 previous errors; 4 warnings emitted
60 For more information about this error, try `rustc --explain E0080`.