@@ -25,14 +25,13 @@ use crate::mem;
2525use crate :: process;
2626#[ cfg( not( target_family = "solana" ) ) ]
2727use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
28+ #[ cfg( not( target_family = "solana" ) ) ]
2829use crate :: sync:: { PoisonError , RwLock } ;
29- #[ cfg( not( target_os = "solana" ) ) ]
30+ #[ cfg( not( target_family = "solana" ) ) ]
3031use crate :: sys:: stdio:: panic_output;
3132#[ cfg( not( target_family = "solana" ) ) ]
3233use crate :: sys_common:: backtrace;
3334#[ cfg( not( target_family = "solana" ) ) ]
34- use crate :: sys_common:: rwlock:: StaticRwLock ;
35- #[ cfg( not( target_family = "solana" ) ) ]
3635use crate :: sys_common:: thread_info;
3736#[ cfg( not( target_family = "solana" ) ) ]
3837use crate :: thread;
@@ -83,7 +82,7 @@ extern "C" fn __rust_foreign_exception() -> ! {
8382 rtabort ! ( "Rust cannot catch foreign exceptions" ) ;
8483}
8584
86- #[ cfg( not( target_os = "solana" ) ) ]
85+ #[ cfg( not( target_family = "solana" ) ) ]
8786enum Hook {
8887 Default ,
8988 Custom ( Box < dyn Fn ( & PanicInfo < ' _ > ) + ' static + Sync + Send > ) ,
@@ -100,15 +99,15 @@ impl Hook {
10099 }
101100}
102101
103- #[ cfg( not( target_os = "solana" ) ) ]
102+ #[ cfg( not( target_family = "solana" ) ) ]
104103impl Default for Hook {
105104 #[ inline]
106105 fn default ( ) -> Hook {
107106 Hook :: Default
108107 }
109108}
110109
111- #[ cfg( not( target_os = "solana" ) ) ]
110+ #[ cfg( not( target_family = "solana" ) ) ]
112111static HOOK : RwLock < Hook > = RwLock :: new ( Hook :: Default ) ;
113112
114113/// Registers a custom panic hook, replacing the previously registered hook.
@@ -441,7 +440,7 @@ pub mod panic_count {
441440 //
442441 // This also updates thread-local state to keep track of whether a panic
443442 // hook is currently executing.
444- #[ cfg( not( target_os = "solana" ) ) ]
443+ #[ cfg( not( target_family = "solana" ) ) ]
445444 pub fn increase ( run_panic_hook : bool ) -> Option < MustAbort > {
446445 let global_count = GLOBAL_PANIC_COUNT . fetch_add ( 1 , Ordering :: Relaxed ) ;
447446 if global_count & ALWAYS_ABORT_FLAG != 0 {
@@ -508,7 +507,7 @@ pub mod panic_count {
508507
509508 // Slow path is in a separate function to reduce the amount of code
510509 // inlined from `count_is_zero`.
511- #[ cfg( not( target_os = "solana" ) ) ]
510+ #[ cfg( not( target_family = "solana" ) ) ]
512511 #[ inline( never) ]
513512 #[ cold]
514513 fn is_zero_slow_path ( ) -> bool {
@@ -661,7 +660,7 @@ pub fn panicking() -> bool {
661660}
662661
663662/// Entry point of panics from the core crate (`panic_impl` lang item).
664- #[ cfg( not( any( test, target_os = "solana" ) ) ) ]
663+ #[ cfg( not( any( test, target_family = "solana" ) ) ) ]
665664#[ panic_handler]
666665pub fn begin_panic_handler ( info : & PanicInfo < ' _ > ) -> ! {
667666 struct FormatStringPayload < ' a > {
0 commit comments