Skip to content

Commit 76d0799

Browse files
dbdrGankra
authored andcommitted
Replace catch_panic by catch_unwind
1 parent 4d2d275 commit 76d0799

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/unwinding.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ panics can only be caught by the parent thread. This means catching a panic
3131
requires spinning up an entire OS thread! This unfortunately stands in conflict
3232
to Rust's philosophy of zero-cost abstractions.
3333

34-
There is an API called `catch_panic` that enables catching a panic
34+
There is an API called [`catch_unwind`][catch_unwind] that enables catching a panic
3535
without spawning a thread. Still, we would encourage you to only do this
3636
sparingly. In particular, Rust's current unwinding implementation is heavily
3737
optimized for the "doesn't unwind" case. If a program doesn't unwind, there
@@ -47,3 +47,5 @@ You must *absolutely* catch any panics at the FFI boundary! What you do at that
4747
point is up to you, but *something* must be done. If you fail to do this,
4848
at best, your application will crash and burn. At worst, your application *won't*
4949
crash and burn, and will proceed with completely clobbered state.
50+
51+
[catch_unwind]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html

0 commit comments

Comments
 (0)