From fe407b61e15a2e69c539f96deef9cd3bfccc10ac Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Thu, 8 Sep 2022 06:57:14 +0100 Subject: [PATCH] Swap usage of drop_panic and foreign_exception --- src/panic.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/panic.rs b/src/panic.rs index 7023135..8d5bd9d 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -8,15 +8,15 @@ pub use crate::panic_handler::*; use crate::panicking::Exception; #[repr(transparent)] -struct RustPanic(Box, ForeignGuard); +struct RustPanic(Box, DropGuard); -struct ForeignGuard; +struct DropGuard; -impl Drop for ForeignGuard { +impl Drop for DropGuard { fn drop(&mut self) { #[cfg(feature = "panic-handler")] { - foreign_exception(); + drop_panic(); } core::intrinsics::abort(); } @@ -45,7 +45,7 @@ unsafe impl Exception for RustPanic { } pub fn begin_panic(payload: Box) -> UnwindReasonCode { - crate::panicking::begin_panic(RustPanic(payload, ForeignGuard)) + crate::panicking::begin_panic(RustPanic(payload, DropGuard)) } pub fn catch_unwind R>(f: F) -> Result> { @@ -55,7 +55,7 @@ pub fn catch_unwind R>(f: F) -> Result> None => { #[cfg(feature = "panic-handler")] { - drop_panic(); + foreign_exception(); } core::intrinsics::abort(); }