@@ -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.
@@ -448,7 +447,7 @@ pub mod panic_count {
448447 //
449448 // This also updates thread-local state to keep track of whether a panic
450449 // hook is currently executing.
451- #[ cfg( not( target_os = "solana" ) ) ]
450+ #[ cfg( not( target_family = "solana" ) ) ]
452451 pub fn increase ( run_panic_hook : bool ) -> Option < MustAbort > {
453452 let global_count = GLOBAL_PANIC_COUNT . fetch_add ( 1 , Ordering :: Relaxed ) ;
454453 if global_count & ALWAYS_ABORT_FLAG != 0 {
@@ -516,7 +515,7 @@ pub mod panic_count {
516515
517516 // Slow path is in a separate function to reduce the amount of code
518517 // inlined from `count_is_zero`.
519- #[ cfg( not( target_os = "solana" ) ) ]
518+ #[ cfg( not( target_family = "solana" ) ) ]
520519 #[ inline( never) ]
521520 #[ cold]
522521 fn is_zero_slow_path ( ) -> bool {
0 commit comments