1
Fork 0
rust/src/test/ui/consts/control-flow/assert.rs
2021-02-03 15:45:43 +01:00

15 lines
481 B
Rust

// 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 any use of this value will cause an error
//[const_panic]~| WARN this was previously accepted by the compiler but is being phased out
fn main() {}