rust/src/test/ui/consts/const-eval/const_panic.rs

27 lines
782 B
Rust
Raw Normal View History

#![feature(const_panic)]
#![crate_type = "lib"]
const Z: () = std::panic!("cheese");
//~^ ERROR any use of this value will cause an error
const Z2: () = std::panic!();
//~^ ERROR any use of this value will cause an error
const Y: () = std::unreachable!();
//~^ ERROR any use of this value will cause an error
const X: () = std::unimplemented!();
//~^ ERROR any use of this value will cause an error
const Z_CORE: () = core::panic!("cheese");
//~^ ERROR any use of this value will cause an error
const Z2_CORE: () = core::panic!();
//~^ ERROR any use of this value will cause an error
const Y_CORE: () = core::unreachable!();
//~^ ERROR any use of this value will cause an error
const X_CORE: () = core::unimplemented!();
//~^ ERROR any use of this value will cause an error