]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/control-flow/assert.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / ui / consts / control-flow / assert.rs
CommitLineData
f035d41b 1// Test that `assert` works when `const_panic` is enabled.
60c5eb7d 2
f035d41b 3// revisions: stock panic
60c5eb7d 4
f035d41b 5#![cfg_attr(panic, feature(const_panic))]
60c5eb7d
XL
6
7const _: () = assert!(true);
f035d41b 8//[stock]~^ ERROR panicking in constants is unstable
60c5eb7d
XL
9
10const _: () = assert!(false);
f035d41b
XL
11//[stock]~^ ERROR panicking in constants is unstable
12//[panic]~^^ ERROR any use of this value will cause an error
60c5eb7d
XL
13
14fn main() {}