]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/unwind-abort.rs
Rollup merge of #80394 - RalfJung:const-err-future, r=oli-obk
[rust.git] / src / test / ui / consts / const-eval / unwind-abort.rs
1 #![feature(unwind_attributes, const_panic)]
2
3 #[unwind(aborts)]
4 const fn foo() {
5     panic!() //~ ERROR any use of this value will cause an error [const_err]
6     //~| WARN this was previously accepted by the compiler but is being phased out
7 }
8
9 const _: () = foo();
10 // Ensure that the CTFE engine handles calls to `#[unwind(aborts)]` gracefully
11
12 fn main() {
13     let _ = foo();
14 }