]>
Commit | Line | Data |
---|---|---|
5869c6ff | 1 | // compile-flags: -Ztreat-err-as-bug=2 |
3dfed10e XL |
2 | // build-fail |
3 | // failure-status: 101 | |
4 | // rustc-env:RUST_BACKTRACE=1 | |
5 | // normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> "" | |
6 | // normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> "" | |
7 | // normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" | |
8 | // normalize-stderr-test "note: compiler flags.*\n\n" -> "" | |
9 | // normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" | |
10 | // normalize-stderr-test "thread.*panicked.*\n" -> "" | |
11 | // normalize-stderr-test "stack backtrace:\n" -> "" | |
12 | // normalize-stderr-test "\s\d{1,}: .*\n" -> "" | |
13 | // normalize-stderr-test "\s at .*\n" -> "" | |
14 | // normalize-stderr-test ".*note: Some details.*\n" -> "" | |
15 | ||
16 | #![allow(unconditional_panic)] | |
17 | ||
5869c6ff XL |
18 | #[warn(const_err)] |
19 | const X: i32 = 1 / 0; //~WARN any use of this value will cause an error | |
20 | //~| WARN this was previously accepted by the compiler but is being phased out | |
21 | ||
3dfed10e | 22 | fn main() { |
5869c6ff XL |
23 | let x: &'static i32 = &X; |
24 | //~^ ERROR evaluation of constant value failed | |
923072b8 FG |
25 | //~| ERROR erroneous constant used |
26 | //~| WARNING this was previously accepted by the compiler | |
3dfed10e XL |
27 | println!("x={}", x); |
28 | } |