]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-eval/const_panic.rs
1 #![allow(non_fmt_panics)]
4 const MSG
: &str = "hello";
6 const Z
: () = std
::panic
!("cheese");
7 //~^ ERROR evaluation of constant value failed
9 const Z2
: () = std
::panic
!();
10 //~^ ERROR evaluation of constant value failed
12 const Y
: () = std
::unreachable
!();
13 //~^ ERROR evaluation of constant value failed
15 const X
: () = std
::unimplemented
!();
16 //~^ ERROR evaluation of constant value failed
18 const W
: () = std
::panic
!(MSG
);
19 //~^ ERROR evaluation of constant value failed
21 const W2
: () = std
::panic
!("{}", MSG
);
22 //~^ ERROR evaluation of constant value failed
24 const Z_CORE
: () = core
::panic
!("cheese");
25 //~^ ERROR evaluation of constant value failed
27 const Z2_CORE
: () = core
::panic
!();
28 //~^ ERROR evaluation of constant value failed
30 const Y_CORE
: () = core
::unreachable
!();
31 //~^ ERROR evaluation of constant value failed
33 const X_CORE
: () = core
::unimplemented
!();
34 //~^ ERROR evaluation of constant value failed
36 const W_CORE
: () = core
::panic
!(MSG
);
37 //~^ ERROR evaluation of constant value failed
39 const W2_CORE
: () = core
::panic
!("{}", MSG
);
40 //~^ ERROR evaluation of constant value failed