Rollup merge of #108924 - tmiasko:panic-immediate-abort, r=thomcc

panic_immediate_abort requires abort as a panic strategy

Guide `panic_immediate_abort` users away from `-Cpanic=unwind` and towards `-Cpanic=abort` to avoid an accidental use of the feature with the unwind strategy, e.g., on a targets where unwind is the default.

The `-Cpanic=unwind` combination doesn't offer the same benefits, since the code would still be generated under the assumption that functions implemented in Rust can unwind.
This commit is contained in:
Matthias Krüger 2023-03-24 01:22:04 +01:00 committed by GitHub
commit d9c05b853d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,9 @@
use crate::fmt;
use crate::panic::{Location, PanicInfo};
#[cfg(feature = "panic_immediate_abort")]
const _: () = assert!(cfg!(panic = "abort"), "panic_immediate_abort requires -C panic=abort");
// First we define the two main entry points that all panics go through.
// In the end both are just convenience wrappers around `panic_impl`.