summary refs log tree commit diff
path: root/src/test/ui/consts/control-flow/assert.rs
blob: 30cd31ee8a734bcb9eea457e8f8d6c7be06d61d7 (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 panic

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

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

const _: () = assert!(false);
//[stock]~^ ERROR panicking in constants is unstable
//[panic]~^^ ERROR any use of this value will cause an error

fn main() {}