Make UnwindTraceFn take &UnwindContext only

This commit is contained in:
Gary Guo 2023-08-06 12:50:27 +01:00
parent 2f9e374431
commit f5ef1d145e
3 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ pub struct UnwindException {
} }
pub type UnwindTraceFn = 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"))] #[cfg(not(feature = "unwinder"))]
#[repr(C)] #[repr(C)]

View File

@ -60,7 +60,7 @@ fn stack_trace() {
counter: usize, counter: usize,
} }
extern "C" fn callback( extern "C" fn callback(
unwind_ctx: &mut UnwindContext<'_>, unwind_ctx: &UnwindContext<'_>,
arg: *mut c_void, arg: *mut c_void,
) -> UnwindReasonCode { ) -> UnwindReasonCode {
let data = unsafe { &mut *(arg as *mut CallbackData) }; let data = unsafe { &mut *(arg as *mut CallbackData) };

View File

@ -390,7 +390,7 @@ pub extern "C-unwind" fn _Unwind_Backtrace(
let frame = try1!(Frame::from_context(&ctx, signal)); let frame = try1!(Frame::from_context(&ctx, signal));
if !skipping { if !skipping {
let code = trace( let code = trace(
&mut UnwindContext { &UnwindContext {
frame: frame.as_ref(), frame: frame.as_ref(),
ctx: &mut ctx, ctx: &mut ctx,
signal, signal,