2018-08-13 06:48:47 -05:00
|
|
|
#![feature(const_panic)]
|
2021-02-01 17:40:17 -06:00
|
|
|
#![allow(non_fmt_panic)]
|
2018-08-26 08:19:34 -05:00
|
|
|
#![crate_type = "lib"]
|
2018-08-13 06:48:47 -05:00
|
|
|
|
2020-10-18 08:02:42 -05:00
|
|
|
const MSG: &str = "hello";
|
|
|
|
|
2020-10-18 07:34:30 -05:00
|
|
|
const Z: () = std::panic!("cheese");
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2018-08-13 06:48:47 -05:00
|
|
|
|
2020-10-18 07:34:30 -05:00
|
|
|
const Z2: () = std::panic!();
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2018-08-13 06:48:47 -05:00
|
|
|
|
2020-10-18 07:34:30 -05:00
|
|
|
const Y: () = std::unreachable!();
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 07:34:30 -05:00
|
|
|
|
|
|
|
const X: () = std::unimplemented!();
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 08:02:42 -05:00
|
|
|
//
|
|
|
|
const W: () = std::panic!(MSG);
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 07:34:30 -05:00
|
|
|
|
|
|
|
const Z_CORE: () = core::panic!("cheese");
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 07:34:30 -05:00
|
|
|
|
|
|
|
const Z2_CORE: () = core::panic!();
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 07:34:30 -05:00
|
|
|
|
|
|
|
const Y_CORE: () = core::unreachable!();
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 07:34:30 -05:00
|
|
|
|
|
|
|
const X_CORE: () = core::unimplemented!();
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-10-18 08:02:42 -05:00
|
|
|
|
|
|
|
const W_CORE: () = core::panic!(MSG);
|
2021-06-15 18:16:10 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|