File tree Expand file tree Collapse file tree 3 files changed +20
-16
lines changed Expand file tree Collapse file tree 3 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -2056,6 +2056,7 @@ dependencies = [
20562056name = " panic_abort"
20572057version = " 0.0.0"
20582058dependencies = [
2059+ " cfg-if" ,
20592060 " compiler_builtins" ,
20602061 " core" ,
20612062 " libc" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ bench = false
1111doc = false
1212
1313[dependencies ]
14+ cfg-if = { version = " 0.1.8" , features = [' rustc-dep-of-std' ] }
1415core = { path = " ../libcore" }
1516libc = { version = " 0.2" , default-features = false }
1617compiler_builtins = " 0.1.0"
Original file line number Diff line number Diff line change @@ -40,23 +40,25 @@ pub unsafe extern "C" fn __rust_panic_cleanup(_: *mut u8) -> *mut (dyn Any + Sen
4040pub unsafe extern "C" fn __rust_start_panic ( _payload : usize ) -> u32 {
4141 abort ( ) ;
4242
43- #[ cfg( any( unix, target_os = "cloudabi" ) ) ]
44- unsafe fn abort ( ) -> ! {
45- libc:: abort ( ) ;
46- }
47-
48- #[ cfg( any( windows, all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ) ]
49- unsafe fn abort ( ) -> ! {
50- core:: intrinsics:: abort ( ) ;
51- }
52-
53- #[ cfg( any( target_os = "hermit" , all( target_vendor = "fortanix" , target_env = "sgx" ) ) ) ]
54- unsafe fn abort ( ) -> ! {
55- // call std::sys::abort_internal
56- extern "C" {
57- pub fn __rust_abort ( ) -> !;
43+ cfg_if:: cfg_if! {
44+ if #[ cfg( any( unix, target_os = "cloudabi" ) ) ] {
45+ unsafe fn abort( ) -> ! {
46+ libc:: abort( ) ;
47+ }
48+ } else if #[ cfg( any( target_os = "hermit" ,
49+ all( target_vendor = "fortanix" , target_env = "sgx" ) ) ) ] {
50+ unsafe fn abort( ) -> ! {
51+ // call std::sys::abort_internal
52+ extern "C" {
53+ pub fn __rust_abort( ) -> !;
54+ }
55+ __rust_abort( ) ;
56+ }
57+ } else {
58+ unsafe fn abort( ) -> ! {
59+ core:: intrinsics:: abort( ) ;
60+ }
5861 }
59- __rust_abort ( ) ;
6062 }
6163}
6264
You can’t perform that action at this time.
0 commit comments