File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1124,7 +1124,14 @@ pub fn exit(code: i32) -> ! {
11241124///
11251125/// Note that because this function never returns, and that it terminates the
11261126/// process, no destructors on the current stack or any other thread's stack
1127- /// will be run. If a clean shutdown is needed it is recommended to only call
1127+ /// will be run.
1128+ ///
1129+ /// This is in contrast to the default behaviour of [`panic!`] which unwinds
1130+ /// the current thread's stack and calls all destructors.
1131+ /// When `panic="abort"` is set, either as an argument to `rustc` or in a
1132+ /// crate's Cargo.toml, [`panic!`] and `abort` are equivalent.
1133+ ///
1134+ /// If a clean shutdown is needed it is recommended to only call
11281135/// this function at a known point where there are no more destructors left
11291136/// to run.
11301137///
@@ -1162,6 +1169,8 @@ pub fn exit(code: i32) -> ! {
11621169/// // the destructor implemented for HasDrop will never get run
11631170/// }
11641171/// ```
1172+ ///
1173+ /// [`panic!`]: ../../std/macro.panic.html
11651174#[ stable( feature = "process_abort" , since = "1.17.0" ) ]
11661175pub fn abort ( ) -> ! {
11671176 unsafe { :: sys:: abort_internal ( ) } ;
You can’t perform that action at this time.
0 commit comments