File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -825,6 +825,21 @@ pub fn exit(code: i32) -> ! {
825825 :: sys:: os:: exit ( code)
826826}
827827
828+ /// Terminates the process in an abnormal fashion.
829+ ///
830+ /// The function will never return and will immediately terminate the current
831+ /// process in a platform specific "abnormal" manner.
832+ ///
833+ /// Note that because this function never returns, and that it terminates the
834+ /// process, no destructors on the current stack or any other thread's stack
835+ /// will be run. If a clean shutdown is needed it is recommended to only call
836+ /// this function at a known point where there are no more destructors left
837+ /// to run.
838+ #[ unstable( feature = "process_abort" , issue = "37838" ) ]
839+ pub fn abort ( ) -> ! {
840+ unsafe { :: sys:: abort_internal ( ) } ;
841+ }
842+
828843#[ cfg( all( test, not( target_os = "emscripten" ) ) ) ]
829844mod tests {
830845 use io:: prelude:: * ;
You can’t perform that action at this time.
0 commit comments