@@ -27,16 +27,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(_: *mut u8) -> *mut (dyn Any + Sen
2727 unreachable ! ( )
2828}
2929
30- // "Leak" the payload and shim to the relevant abort on the platform in
31- // question.
32- //
33- // For Unix we just use `abort` from libc as it'll trigger debuggers, core
34- // dumps, etc, as one might expect. On Windows, however, the best option we have
35- // is the `__fastfail` intrinsics, but that's unfortunately not defined in LLVM,
36- // and the `RaiseFailFastException` function isn't available until Windows 7
37- // which would break compat with XP. For now just use `intrinsics::abort` which
38- // will kill us with an illegal instruction, which will do a good enough job for
39- // now hopefully.
30+ // "Leak" the payload and shim to the relevant abort on the platform in question.
4031#[ rustc_std_internal_symbol]
4132pub unsafe extern "C" fn __rust_start_panic ( _payload : usize ) -> u32 {
4233 abort ( ) ;
@@ -57,14 +48,16 @@ pub unsafe extern "C" fn __rust_start_panic(_payload: usize) -> u32 {
5748 __rust_abort( ) ;
5849 }
5950 } else if #[ cfg( all( windows, any( target_arch = "x86" , target_arch = "x86_64" ) ) ) ] {
60- // On Windows, use the processor-specific __fastfail mechanism. In Windows 8
51+ // On Windows, use the processor-specific __fastfail mechanism. In Windows 8
6152 // and later, this will terminate the process immediately without running any
62- // in-process exception handlers. In earlier versions of Windows, this
53+ // in-process exception handlers. In earlier versions of Windows, this
6354 // sequence of instructions will be treated as an access violation,
6455 // terminating the process but without necessarily bypassing all exception
6556 // handlers.
6657 //
6758 // https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail
59+ //
60+ // Note: this is the same implementation as in libstd's `abort_internal`
6861 unsafe fn abort( ) -> ! {
6962 llvm_asm!( "int $$0x29" :: "{ecx}" ( 7 ) :: : volatile) ; // 7 is FAST_FAIL_FATAL_APP_EXIT
7063 core:: intrinsics:: unreachable( ) ;
0 commit comments