]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-eval/const_panic_libcore_main.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / const_panic_libcore_main.rs
CommitLineData
b7449926 1#![crate_type = "bin"]
94b46f34 2#![feature(lang_items)]
b7449926 3#![feature(const_panic)]
94b46f34 4#![no_main]
b7449926 5#![no_std]
9e0c209e 6
94b46f34
XL
7use core::panic::PanicInfo;
8
b7449926 9const Z: () = panic!("cheese");
a1dfa0c6 10//~^ ERROR any use of this value will cause an error
b7449926
XL
11
12const Y: () = unreachable!();
a1dfa0c6 13//~^ ERROR any use of this value will cause an error
b7449926
XL
14
15const X: () = unimplemented!();
a1dfa0c6 16//~^ ERROR any use of this value will cause an error
83c7162d 17
94b46f34
XL
18#[lang = "eh_personality"]
19fn eh() {}
1b1a35ee
XL
20#[lang = "eh_catch_typeinfo"]
21static EH_CATCH_TYPEINFO: u8 = 0;
b7449926
XL
22
23#[panic_handler]
24fn panic(_info: &PanicInfo) -> ! {
25 loop {}
26}