Skip to content

Commit

Permalink
Auto merge of #33767 - sfackler:panic-hook-docs, r=alexcrichton
Browse files Browse the repository at this point in the history
Mention that the panic hook will always run

r? @alexcrichton

cc @tomaka
  • Loading branch information
bors committed May 21, 2016
2 parents da41920 + 78e06ad commit 476fe6e
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 476fe6e

Please sign in to comment.