]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-eval/const_panic_2021.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / const_panic_2021.rs
CommitLineData
94222f64 1// edition:2021
94222f64
XL
2#![crate_type = "lib"]
3
c295e0f8
XL
4const MSG: &str = "hello";
5
94222f64
XL
6const A: () = std::panic!("blÄhaj");
7//~^ ERROR evaluation of constant value failed
8
9const B: () = std::panic!();
10//~^ ERROR evaluation of constant value failed
11
12const C: () = std::unreachable!();
13//~^ ERROR evaluation of constant value failed
14
15const D: () = std::unimplemented!();
16//~^ ERROR evaluation of constant value failed
17
c295e0f8
XL
18const E: () = std::panic!("{}", MSG);
19//~^ ERROR evaluation of constant value failed
20
21const A_CORE: () = core::panic!("shark");
22//~^ ERROR evaluation of constant value failed
23
24const B_CORE: () = core::panic!();
94222f64
XL
25//~^ ERROR evaluation of constant value failed
26
c295e0f8 27const C_CORE: () = core::unreachable!();
94222f64
XL
28//~^ ERROR evaluation of constant value failed
29
c295e0f8 30const D_CORE: () = core::unimplemented!();
94222f64
XL
31//~^ ERROR evaluation of constant value failed
32
c295e0f8 33const E_CORE: () = core::panic!("{}", MSG);
94222f64 34//~^ ERROR evaluation of constant value failed