From 20de2f7e0f2a3143893e2c4768119c209bd8bc98 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sun, 5 Oct 2025 09:10:08 -0400 Subject: [PATCH 1/2] docs: fix the panic-immediate-abort feature name --- src/doc/src/reference/unstable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index 38ca71cd0bd..516511cdee4 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -1684,7 +1684,7 @@ Allow use of [`-Cpanic=immediate-abort`](../../rustc/codegen-options/index.html# This can be enabled like so: ```toml -cargo-features = ["immediate-abort"] +cargo-features = ["panic-immediate-abort"] [package] # ... From 7ae5ebe502ff85aff9af9cf39cb918551848fc94 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sun, 5 Oct 2025 09:17:00 -0400 Subject: [PATCH 2/2] docs: clarify panic-immediate-abort can be used in config --- src/doc/src/reference/unstable.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index 516511cdee4..2767e247ea1 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -1680,10 +1680,12 @@ cargo-features = ["open-namespaces"] * Tracking Issue: [#16042](https://github.com/rust-lang/cargo/issues/16042) * Upstream Tracking Issue: [rust-lang/rust#147286](https://github.com/rust-lang/rust/issues/147286) -Allow use of [`-Cpanic=immediate-abort`](../../rustc/codegen-options/index.html#panic) through a Cargo profile - +Extends the `panic` profile setting to support the +[`immediate-abort`](../../rustc/codegen-options/index.html#panic) panic strategy. This can be enabled like so: + ```toml +# Cargo.toml cargo-features = ["panic-immediate-abort"] [package] @@ -1693,6 +1695,20 @@ cargo-features = ["panic-immediate-abort"] panic = "immediate-abort" ``` +To set this in a profile in Cargo configuration, +you need to use either `-Z panic-immediate-abort` CLI flag +or the `[unstable]` table to enable it. +For example, + +```toml +# .cargo/config.toml +[unstable] +panic-immediate-abort = true + +[profile.release] +panic = "immediate-abort" +``` + ## `[lints.cargo]` * Tracking Issue: [#12235](https://github.com/rust-lang/cargo/issues/12235)