From f5ef1d145ed79293fa07aceb5a26b743f450a4fe Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Sun, 6 Aug 2023 12:50:27 +0100 Subject: [PATCH] Make UnwindTraceFn take `&UnwindContext` only --- src/abi.rs | 2 +- src/panic_handler.rs | 2 +- src/unwinder/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abi.rs b/src/abi.rs index 737cb0f..9c89f2c 100644 --- a/src/abi.rs +++ b/src/abi.rs @@ -78,7 +78,7 @@ pub struct UnwindException { } pub type UnwindTraceFn = - extern "C" fn(ctx: &mut UnwindContext<'_>, arg: *mut c_void) -> UnwindReasonCode; + extern "C" fn(ctx: &UnwindContext<'_>, arg: *mut c_void) -> UnwindReasonCode; #[cfg(not(feature = "unwinder"))] #[repr(C)] diff --git a/src/panic_handler.rs b/src/panic_handler.rs index beca6ff..5ba13a6 100644 --- a/src/panic_handler.rs +++ b/src/panic_handler.rs @@ -60,7 +60,7 @@ fn stack_trace() { counter: usize, } extern "C" fn callback( - unwind_ctx: &mut UnwindContext<'_>, + unwind_ctx: &UnwindContext<'_>, arg: *mut c_void, ) -> UnwindReasonCode { let data = unsafe { &mut *(arg as *mut CallbackData) }; diff --git a/src/unwinder/mod.rs b/src/unwinder/mod.rs index 968566b..d650db7 100644 --- a/src/unwinder/mod.rs +++ b/src/unwinder/mod.rs @@ -390,7 +390,7 @@ pub extern "C-unwind" fn _Unwind_Backtrace( let frame = try1!(Frame::from_context(&ctx, signal)); if !skipping { let code = trace( - &mut UnwindContext { + &UnwindContext { frame: frame.as_ref(), ctx: &mut ctx, signal,