Skip to content

Commit d0b5b1f

Browse files
committed
default isn't always panic_unwind
1 parent 3475019 commit d0b5b1f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/panic.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ panic traverses Rust frames, live objects in those frames that [implement
2020
recovery does occur (for instance at a thread boundary), the objects will have
2121
been "cleaned up" just as if they had gone out of scope normally.
2222

23-
> **Note**: As long as this guarantee of resource-cleanup is preserved, "unwinding" may
24-
> be implemented without actually using the mechanism used by C++ for the
25-
> target platform.
23+
> **Note**: As long as this guarantee of resource-cleanup is preserved,
24+
> "unwinding" may be implemented without actually using the mechanism used by
25+
> C++ for the target platform.
2626
2727
> **Note**: The Standard Library provides two mechanisms for recovering from a panic,
2828
> [`catch_unwind`][fn-catch-unwind] (which enables recovery within the
@@ -34,9 +34,11 @@ been "cleaned up" just as if they had gone out of scope normally.
3434
The actual behavior and implementation of `panic!` is controlled by the _panic
3535
runtime_.
3636

37-
> **Note**: The Rust standard library provides two panic runtimes: `panic_unwind` (the
38-
> default) and `panic_abort`, which immediately aborts the process (which is
39-
> non-recoverable).
37+
> **Note**: The Rust standard library provides two panic runtimes:
38+
> `panic_unwind` (which unwinds the stack and is potentially recoverable) and
39+
> `panic_abort` (which aborts the process and is non-recoverable). The default
40+
> runtime depends on the target platform, but is generally `panic_unwind` on
41+
> platforms with native support for C++ exceptions.
4042
4143
When compiling code that is guaranteed to be linked to a non-recoverable panic
4244
runtime, the optimizer may assume that unwinding across Rust frames is

0 commit comments

Comments
 (0)