File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 2525//!
2626//! Fatal logic errors in Rust cause *thread panic*, during which
2727//! a thread will unwind the stack, running destructors and freeing
28- //! owned resources. Thread panic is unrecoverable from within
29- //! the panicking thread (i.e. there is no 'try/catch' in Rust), but
30- //! the panic may optionally be detected from a different thread. If
31- //! the main thread panics, the application will exit with a non-zero
32- //! exit code.
28+ //! owned resources. While not meant as a 'try/catch' mechanism, panics
29+ //! in Rust can nonetheless be caught (unless compiling with `panic=abort`) with
30+ //! [`catch_unwind`](../../std/panic/fn.catch_unwind.html) and recovered
31+ //! from, or alternatively be resumed with
32+ //! [`resume_unwind`](../../std/panic/fn.resume_unwind.html). If the panic
33+ //! is not caught the thread will exit, but the panic may optionally be
34+ //! detected from a different thread with [`join`]. If the main thread panics
35+ //! without the panic being caught, the application will exit with a
36+ //! non-zero exit code.
3337//!
3438//! When the main thread of a Rust program terminates, the entire program shuts
3539//! down, even if other threads are still running. However, this module provides
You can’t perform that action at this time.
0 commit comments