rust/src/test/ui/consts/control-flow/assert.rs
Smitty 4fe4ff95f6 Use better error message for hard errors in CTFE
Currently the same message is used for hard errors and soft errors. This
makes hard errors use a message that indicates the reality of the
situation correctly, since usage of the constant is never allowed when
there was a hard error evaluating it.
2021-06-15 19:16:10 -04:00

14 lines
383 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 evaluation of constant value failed
fn main() {}