We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23d0a3a commit e4b1ab9Copy full SHA for e4b1ab9
src/conditional-compilation.md
@@ -253,6 +253,19 @@ fn on_32bit_unix() {
253
fn needs_not_foo() {
254
// ...
255
}
256
+
257
+// This function is only included when the panic strategy is set to unwind
258
+#[cfg(panic = "unwind")]
259
+fn when_unwinding() {
260
+ // ...
261
+}
262
263
+// This function is only included when the panic strategy is not set to unwind
264
+#[cfg(not(panic="unwind"))]
265
+fn when_aborting() {
266
267
268
269
```
270
271
The `cfg` attribute is allowed anywhere attributes are allowed.
0 commit comments