diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index 8085cbfab..6966cec4f 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -208,6 +208,15 @@ production. For example, it controls the behavior of the standard library's Set when the crate being compiled is being compiled with the `proc_macro` [crate type]. +### `panic` + +Key-value option set depending on the panic strategy. Note that more values may be added in the future. + +Example values: + +* `"abort"` +* `"unwind"` + ## Forms of conditional compilation ### The `cfg` attribute @@ -253,6 +262,13 @@ fn on_32bit_unix() { fn needs_not_foo() { // ... } + +// This function is only included when the panic strategy is set to unwind +#[cfg(panic = "unwind")] +fn when_unwinding() { + // ... +} + ``` The `cfg` attribute is allowed anywhere attributes are allowed.