]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/control-flow/assert.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / consts / control-flow / assert.rs
1 // Test that `assert` works when `const_panic` is enabled.
2
3 // revisions: stock const_panic
4
5 #![cfg_attr(const_panic, feature(const_panic))]
6
7 const _: () = assert!(true);
8 //[stock]~^ ERROR panicking in constants is unstable
9
10 const _: () = assert!(false);
11 //[stock]~^ ERROR panicking in constants is unstable
12 //[const_panic]~^^ ERROR evaluation of constant value failed
13
14 fn main() {}