Skip to content

Commit

Permalink
Mention that the panic hook will always run
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed May 20, 2016
1 parent 179539f commit 78e06ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libstd/panic.rs
Expand Up @@ -395,7 +395,7 @@ pub fn recover<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
catch_unwind(f)
}

/// Triggers a panic without invoking the panic handler.
/// Triggers a panic without invoking the panic hook.
///
/// This is designed to be used in conjunction with `catch_unwind` to, for
/// example, carry a panic across a layer of C code.
Expand Down
9 changes: 5 additions & 4 deletions src/libstd/panicking.rs
Expand Up @@ -75,10 +75,11 @@ static FIRST_PANIC: AtomicBool = AtomicBool::new(true);

/// Registers a custom panic hook, replacing any that was previously registered.
///
/// The panic hook is invoked when a thread panics, but before it begins
/// unwinding the stack. The default hook prints a message to standard error
/// and generates a backtrace if requested, but this behavior can be customized
/// with the `set_hook` and `take_hook` functions.
/// The panic hook is invoked when a thread panics, but before the panic runtime
/// is invoked. As such, the hook will run with both the aborting and unwinding
/// runtimes. The default hook prints a message to standard error and generates
/// a backtrace if requested, but this behavior can be customized with the
/// `set_hook` and `take_hook` functions.
///
/// The hook is provided with a `PanicInfo` struct which contains information
/// about the origin of the panic, including the payload passed to `panic!` and
Expand Down

0 comments on commit 78e06ad

Please sign in to comment.