9
9
10
10
#![ deny( unsafe_op_in_unsafe_fn) ]
11
11
12
- #[ cfg( not( target_os = "solana" ) ) ]
12
+ #[ cfg( not( target_family = "solana" ) ) ]
13
13
use crate :: panic:: BacktraceStyle ;
14
- #[ cfg( all( not( target_arch = "bpf" ) , not( target_arch = "sbf" ) ) ) ]
15
- use crate :: intrinsics;
16
- #[ cfg( not( target_os = "solana" ) ) ]
17
- use crate :: panic:: PanicHookInfo ;
18
- #[ cfg( not( target_os = "solana" ) ) ]
14
+ #[ cfg( not( target_family = "solana" ) ) ]
19
15
use core:: panic:: PanicPayload ;
16
+ #[ cfg( target_family = "solana" ) ]
17
+ use core:: panic:: PanicInfo ;
20
18
use core:: panic:: Location ;
19
+
21
20
use crate :: any:: Any ;
21
+ use crate :: fmt;
22
+ use crate :: intrinsics;
23
+ #[ cfg( not( target_os = "solana" ) ) ]
24
+ use crate :: panic:: PanicHookInfo ;
22
25
#[ cfg( not( test) ) ]
23
26
use crate :: io:: try_set_output_capture;
24
27
use crate :: mem:: ManuallyDrop ;
25
28
#[ cfg( not( target_family = "solana" ) ) ]
26
- use crate :: fmt;
27
- #[ cfg( not( target_family = "solana" ) ) ]
28
29
use crate :: mem;
29
30
#[ cfg( not( target_family = "solana" ) ) ]
30
31
use crate :: process;
@@ -524,14 +525,12 @@ pub use realstd::rt::panic_count;
524
525
525
526
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
526
527
#[ cfg( feature = "panic_immediate_abort" ) ]
527
- #[ cfg( all( not( target_arch = "bpf" ) , not( target_arch = "sbf" ) ) ) ]
528
528
pub unsafe fn r#try < R , F : FnOnce ( ) -> R > ( f : F ) -> Result < R , Box < dyn Any + Send > > {
529
529
Ok ( f ( ) )
530
530
}
531
531
532
532
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
533
533
#[ cfg( not( feature = "panic_immediate_abort" ) ) ]
534
- #[ cfg( all( not( target_arch = "bpf" ) , not( target_arch = "sbf" ) ) ) ]
535
534
pub unsafe fn r#try < R , F : FnOnce ( ) -> R > ( f : F ) -> Result < R , Box < dyn Any + Send > > {
536
535
union Data < F , R > {
537
536
f : ManuallyDrop < F > ,
@@ -987,6 +986,7 @@ pub fn begin_panic<M: Any + Send>(_msg: M) -> ! {
987
986
None ,
988
987
Location :: caller ( ) ,
989
988
false ,
989
+ false ,
990
990
) ;
991
991
crate :: sys:: panic ( & info) ;
992
992
}
@@ -1005,6 +1005,7 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
1005
1005
Some ( msg) ,
1006
1006
Location :: caller ( ) ,
1007
1007
false ,
1008
+ false ,
1008
1009
) ;
1009
1010
crate :: sys:: panic ( & info) ;
1010
1011
}
0 commit comments