1 warning: this constant cannot be used
2 --> $DIR/issue-43197.rs:20:5
4 LL | const X: u32 = 0-1;
7 | attempt to subtract with overflow
9 note: lint level defined here
10 --> $DIR/issue-43197.rs:11:9
12 LL | #![warn(const_err)]
15 warning: this constant cannot be used
16 --> $DIR/issue-43197.rs:22:5
18 LL | const Y: u32 = foo(0-1);
19 | ^^^^^^^^^^^^^^^^^^^---^^
21 | attempt to subtract with overflow
23 warning: referenced constant has errors
24 --> $DIR/issue-43197.rs:24:23
26 LL | const X: u32 = 0-1;
27 | --- attempt to subtract with overflow
29 LL | println!("{} {}", X, Y);
32 warning: this expression will panic at runtime
33 --> $DIR/issue-43197.rs:24:23
35 LL | println!("{} {}", X, Y);
36 | ^ referenced constant has errors
38 warning: referenced constant has errors
39 --> $DIR/issue-43197.rs:24:26
41 LL | const Y: u32 = foo(0-1);
42 | --- attempt to subtract with overflow
43 LL | //~^ WARN this constant cannot be used
44 LL | println!("{} {}", X, Y);
47 warning: this expression will panic at runtime
48 --> $DIR/issue-43197.rs:24:26
50 LL | println!("{} {}", X, Y);
51 | ^ referenced constant has errors
53 error[E0080]: referenced constant has errors
54 --> $DIR/issue-43197.rs:24:26
56 LL | const Y: u32 = foo(0-1);
57 | --- attempt to subtract with overflow
58 LL | //~^ WARN this constant cannot be used
59 LL | println!("{} {}", X, Y);
62 error[E0080]: erroneous constant used
63 --> $DIR/issue-43197.rs:24:26
65 LL | println!("{} {}", X, Y);
66 | ^ referenced constant has errors
68 error[E0080]: referenced constant has errors
69 --> $DIR/issue-43197.rs:24:23
71 LL | const X: u32 = 0-1;
72 | --- attempt to subtract with overflow
74 LL | println!("{} {}", X, Y);
77 error[E0080]: erroneous constant used
78 --> $DIR/issue-43197.rs:24:23
80 LL | println!("{} {}", X, Y);
81 | ^ referenced constant has errors
83 error: aborting due to 4 previous errors
85 For more information about this error, try `rustc --explain E0080`.