Skip to content

Commit 7ae5ebe

Browse files
committed
docs: clarify panic-immediate-abort can be used in config
1 parent 20de2f7 commit 7ae5ebe

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/doc/src/reference/unstable.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,10 +1680,12 @@ cargo-features = ["open-namespaces"]
16801680
* Tracking Issue: [#16042](https://github.com/rust-lang/cargo/issues/16042)
16811681
* Upstream Tracking Issue: [rust-lang/rust#147286](https://github.com/rust-lang/rust/issues/147286)
16821682

1683-
Allow use of [`-Cpanic=immediate-abort`](../../rustc/codegen-options/index.html#panic) through a Cargo profile
1684-
1683+
Extends the `panic` profile setting to support the
1684+
[`immediate-abort`](../../rustc/codegen-options/index.html#panic) panic strategy.
16851685
This can be enabled like so:
1686+
16861687
```toml
1688+
# Cargo.toml
16871689
cargo-features = ["panic-immediate-abort"]
16881690

16891691
[package]
@@ -1693,6 +1695,20 @@ cargo-features = ["panic-immediate-abort"]
16931695
panic = "immediate-abort"
16941696
```
16951697

1698+
To set this in a profile in Cargo configuration,
1699+
you need to use either `-Z panic-immediate-abort` CLI flag
1700+
or the `[unstable]` table to enable it.
1701+
For example,
1702+
1703+
```toml
1704+
# .cargo/config.toml
1705+
[unstable]
1706+
panic-immediate-abort = true
1707+
1708+
[profile.release]
1709+
panic = "immediate-abort"
1710+
```
1711+
16961712
## `[lints.cargo]`
16971713

16981714
* Tracking Issue: [#12235](https://github.com/rust-lang/cargo/issues/12235)

0 commit comments

Comments
 (0)