@@ -984,18 +984,9 @@ fn loaded_stack_map_section() -> Option<&'static [u8]> {
984984#[ cfg( any( target_vendor = "apple" , target_os = "linux" ) ) ]
985985mod unwind {
986986 use super :: * ;
987-
988- #[ repr( C ) ]
989- struct UnwindContext {
990- _private : [ u8 ; 0 ] ,
991- }
987+ use crate :: eh:: { _Unwind_Backtrace, _Unwind_GetIP, UnwindContext , UnwindReasonCode } ;
992988
993989 unsafe extern "C" {
994- fn _Unwind_Backtrace (
995- trace : unsafe extern "C" fn ( * mut UnwindContext , * mut c_void ) -> i32 ,
996- argument : * mut c_void ,
997- ) -> i32 ;
998- fn _Unwind_GetIP ( context : * mut UnwindContext ) -> usize ;
999990 fn _Unwind_GetGR ( context : * mut UnwindContext , register : i32 ) -> usize ;
1000991 /// The frame's canonical frame address — the supported way to reach a
1001992 /// frame's stack pointer. `_Unwind_GetGR` on the SP column is not a
@@ -1033,7 +1024,7 @@ mod unwind {
10331024 unsafe extern "C" fn walk_frame < F : FnMut ( MutableRootSlot ) > (
10341025 context : * mut UnwindContext ,
10351026 argument : * mut c_void ,
1036- ) -> i32 {
1027+ ) -> UnwindReasonCode {
10371028 let state = & mut * argument. cast :: < WalkState < ' _ , F > > ( ) ;
10381029 state. stats . frames_visited = state. stats . frames_visited . saturating_add ( 1 ) ;
10391030 let ip = _Unwind_GetIP ( context) ;
@@ -1360,11 +1351,7 @@ mod fp_chain {
13601351 // the alternative was this module quietly not existing there.
13611352 #[ cfg( target_vendor = "apple" ) ]
13621353 fn stack_top ( ) -> usize {
1363- unsafe extern "C" {
1364- fn pthread_self ( ) -> usize ;
1365- fn pthread_get_stackaddr_np ( thread : usize ) -> * mut c_void ;
1366- }
1367- unsafe { pthread_get_stackaddr_np( pthread_self( ) ) as usize }
1354+ unsafe { libc:: pthread_get_stackaddr_np ( libc:: pthread_self ( ) ) as usize }
13681355 }
13691356
13701357 /// Linux (#7173): stack bounds via pthread attrs — the returned address
0 commit comments