summary refs log tree commit diff
path: root/src/test/ui/consts/control-flow/assert.rs
blob: b311cb140ccf69d03b45863c0fcd651b74ed3ccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Test that `assert` works when `const_panic` is enabled.

// revisions: stock const_panic

#![cfg_attr(const_panic, feature(const_panic))]

const _: () = assert!(true);
//[stock]~^ ERROR panicking in constants is unstable

const _: () = assert!(false);
//[stock]~^ ERROR panicking in constants is unstable
//[const_panic]~^^ ERROR evaluation of constant value failed

fn main() {}