88#![ doc( issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/" ) ]
99#![ panic_runtime]
1010#![ allow( unused_features) ]
11+ #![ feature( cfg_match) ]
1112#![ feature( core_intrinsics) ]
1213#![ feature( panic_runtime) ]
1314#![ feature( std_internals) ]
@@ -37,24 +38,26 @@ pub unsafe fn __rust_start_panic(_payload: &mut dyn PanicPayload) -> u32 {
3738
3839 abort ( ) ;
3940
40- cfg_if :: cfg_if ! {
41- if # [ cfg( any( unix, target_os = "solid_asp3" ) ) ] {
41+ cfg_match ! {
42+ cfg( any( unix, target_os = "solid_asp3" ) ) => {
4243 unsafe fn abort( ) -> ! {
4344 libc:: abort( ) ;
4445 }
45- } else if #[ cfg( any( target_os = "hermit" ,
46- all( target_vendor = "fortanix" , target_env = "sgx" ) ,
47- target_os = "xous" ,
48- target_os = "uefi" ,
49- ) ) ] {
46+ }
47+ cfg( any( target_os = "hermit" ,
48+ all( target_vendor = "fortanix" , target_env = "sgx" ) ,
49+ target_os = "xous" ,
50+ target_os = "uefi" ,
51+ ) ) => {
5052 unsafe fn abort( ) -> ! {
5153 // call std::sys::abort_internal
5254 extern "C" {
5355 pub fn __rust_abort( ) -> !;
5456 }
5557 __rust_abort( ) ;
5658 }
57- } else if #[ cfg( all( windows, not( miri) ) ) ] {
59+ }
60+ cfg( all( windows, not( miri) ) ) => {
5861 // On Windows, use the processor-specific __fastfail mechanism. In Windows 8
5962 // and later, this will terminate the process immediately without running any
6063 // in-process exception handlers. In earlier versions of Windows, this
@@ -68,20 +71,24 @@ pub unsafe fn __rust_start_panic(_payload: &mut dyn PanicPayload) -> u32 {
6871 unsafe fn abort( ) -> ! {
6972 #[ allow( unused) ]
7073 const FAST_FAIL_FATAL_APP_EXIT : usize = 7 ;
71- cfg_if :: cfg_if ! {
72- if # [ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ] {
74+ cfg_match ! {
75+ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) => {
7376 core:: arch:: asm!( "int $$0x29" , in( "ecx" ) FAST_FAIL_FATAL_APP_EXIT ) ;
74- } else if #[ cfg( all( target_arch = "arm" , target_feature = "thumb-mode" ) ) ] {
77+ }
78+ cfg( all( target_arch = "arm" , target_feature = "thumb-mode" ) ) => {
7579 core:: arch:: asm!( ".inst 0xDEFB" , in( "r0" ) FAST_FAIL_FATAL_APP_EXIT ) ;
76- } else if #[ cfg( target_arch = "aarch64" ) ] {
80+ }
81+ cfg( target_arch = "aarch64" ) => {
7782 core:: arch:: asm!( "brk 0xF003" , in( "x0" ) FAST_FAIL_FATAL_APP_EXIT ) ;
78- } else {
83+ }
84+ _ => {
7985 core:: intrinsics:: abort( ) ;
8086 }
8187 }
8288 core:: intrinsics:: unreachable( ) ;
8389 }
84- } else {
90+ }
91+ _ => {
8592 unsafe fn abort( ) -> ! {
8693 core:: intrinsics:: abort( ) ;
8794 }
0 commit comments