]> git.lizzy.rs Git - rust.git/commitdiff
Mention that the panic hook will always run
authorSteven Fackler <sfackler@gmail.com>
Fri, 20 May 2016 05:35:09 +0000 (22:35 -0700)
committerSteven Fackler <sfackler@gmail.com>
Fri, 20 May 2016 05:35:09 +0000 (22:35 -0700)
src/libstd/panic.rs
src/libstd/panicking.rs

index a2c6e79fb92fc8c8010be2d2108aabf7b03d9d4a..3b170dc9c6d5f58987a382d414be3c589b46fb0c 100644 (file)
@@ -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.
index b85d4b330a6e336d9107747d45624b1108eb8d23..3ad330e79fa249d1df5bc4bba61766a606110e69 100644 (file)
@@ -75,10 +75,11 @@ enum Hook {
 
 /// 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