]> git.lizzy.rs Git - rust.git/commitdiff
Document that process::abort will not call the panic hook
authorPirh <pirh.badger@gmail.com>
Mon, 2 Oct 2017 18:59:50 +0000 (19:59 +0100)
committerPirh <pirh.badger@gmail.com>
Mon, 2 Oct 2017 18:59:50 +0000 (19:59 +0100)
src/libstd/process.rs

index fa9ec4b31856bbba07d59b432302c6b4b0665d61..dbb589912153cd0da92b678f1732d9e6c13fd6fc 100644 (file)
@@ -1129,7 +1129,8 @@ pub fn exit(code: i32) -> ! {
 /// This is in contrast to the default behaviour of [`panic!`] which unwinds
 /// the current thread's stack and calls all destructors.
 /// When `panic="abort"` is set, either as an argument to `rustc` or in a
-/// crate's Cargo.toml, [`panic!`] and `abort` are equivalent.
+/// crate's Cargo.toml, [`panic!`] and `abort` are similar. However,
+/// [`panic!`] will still call the [panic hook] while `abort` will not.
 ///
 /// If a clean shutdown is needed it is recommended to only call
 /// this function at a known point where there are no more destructors left
@@ -1171,6 +1172,7 @@ pub fn exit(code: i32) -> ! {
 /// ```
 ///
 /// [`panic!`]: ../../std/macro.panic.html
+/// [panic hook]: ../../std/panic/fn.set_hook.html
 #[stable(feature = "process_abort", since = "1.17.0")]
 pub fn abort() -> ! {
     unsafe { ::sys::abort_internal() };