]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-eval/const_panic_libcore_bin.rs
Bless and update consts tests
[rust.git] / tests / ui / consts / const-eval / const_panic_libcore_bin.rs
1 #![crate_type = "bin"]
2 #![feature(lang_items)]
3 #![no_main]
4 #![no_std]
5
6 use core::panic::PanicInfo;
7
8 const Z: () = panic!("cheese");
9 //~^ ERROR evaluation of constant value failed
10
11 const Y: () = unreachable!();
12 //~^ ERROR evaluation of constant value failed
13
14 const X: () = unimplemented!();
15 //~^ ERROR evaluation of constant value failed
16
17 #[lang = "eh_personality"]
18 fn eh() {}
19 #[lang = "eh_catch_typeinfo"]
20 static EH_CATCH_TYPEINFO: u8 = 0;
21
22 #[panic_handler]
23 fn panic(_info: &PanicInfo) -> ! {
24     loop {}
25 }