]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | #![feature(const_panic)] |
136023e0 | 2 | #![allow(non_fmt_panics)] |
a1dfa0c6 | 3 | #![crate_type = "lib"] |
94b46f34 | 4 | |
29967ef6 XL |
5 | const MSG: &str = "hello"; |
6 | ||
7 | const Z: () = std::panic!("cheese"); | |
136023e0 | 8 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
9 | |
10 | const Z2: () = std::panic!(); | |
136023e0 | 11 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
12 | |
13 | const Y: () = std::unreachable!(); | |
136023e0 | 14 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
15 | |
16 | const X: () = std::unimplemented!(); | |
136023e0 | 17 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
18 | // |
19 | const W: () = std::panic!(MSG); | |
136023e0 | 20 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
21 | |
22 | const Z_CORE: () = core::panic!("cheese"); | |
136023e0 | 23 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
24 | |
25 | const Z2_CORE: () = core::panic!(); | |
136023e0 | 26 | //~^ ERROR evaluation of constant value failed |
29967ef6 XL |
27 | |
28 | const Y_CORE: () = core::unreachable!(); | |
136023e0 | 29 | //~^ ERROR evaluation of constant value failed |
94b46f34 | 30 | |
29967ef6 | 31 | const X_CORE: () = core::unimplemented!(); |
136023e0 | 32 | //~^ ERROR evaluation of constant value failed |
94b46f34 | 33 | |
29967ef6 | 34 | const W_CORE: () = core::panic!(MSG); |
136023e0 | 35 | //~^ ERROR evaluation of constant value failed |