File tree 1 file changed +10
-1
lines changed
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) -> ! {
1124
1124
///
1125
1125
/// Note that because this function never returns, and that it terminates the
1126
1126
/// 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
1128
1135
/// this function at a known point where there are no more destructors left
1129
1136
/// to run.
1130
1137
///
@@ -1162,6 +1169,8 @@ pub fn exit(code: i32) -> ! {
1162
1169
/// // the destructor implemented for HasDrop will never get run
1163
1170
/// }
1164
1171
/// ```
1172
+ ///
1173
+ /// [`panic!`]: ../../std/macro.panic.html
1165
1174
#[ stable( feature = "process_abort" , since = "1.17.0" ) ]
1166
1175
pub fn abort ( ) -> ! {
1167
1176
unsafe { :: sys:: abort_internal ( ) } ;
You can’t perform that action at this time.
0 commit comments