Skip to content

Commit 28ef0d1

Browse files
author
Pirh
committed
Document that process::abort will not call the panic hook
1 parent 7ab20c8 commit 28ef0d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libstd/process.rs

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

0 commit comments

Comments
 (0)