]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-eval/const_panic_2021.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / const_panic_2021.rs
1 // edition:2021
2 #![feature(const_panic)]
3 #![crate_type = "lib"]
4
5 const A: () = std::panic!("blÄhaj");
6 //~^ ERROR evaluation of constant value failed
7
8 const B: () = std::panic!();
9 //~^ ERROR evaluation of constant value failed
10
11 const C: () = std::unreachable!();
12 //~^ ERROR evaluation of constant value failed
13
14 const D: () = std::unimplemented!();
15 //~^ ERROR evaluation of constant value failed
16
17 const E: () = core::panic!("shark");
18 //~^ ERROR evaluation of constant value failed
19
20 const F: () = core::panic!();
21 //~^ ERROR evaluation of constant value failed
22
23 const G: () = core::unreachable!();
24 //~^ ERROR evaluation of constant value failed
25
26 const H: () = core::unimplemented!();
27 //~^ ERROR evaluation of constant value failed