summaryrefslogtreecommitdiffstats
path: root/library/panic_unwind/src/dummy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/panic_unwind/src/dummy.rs')
-rw-r--r--library/panic_unwind/src/dummy.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/library/panic_unwind/src/dummy.rs b/library/panic_unwind/src/dummy.rs
new file mode 100644
index 000000000..a4bcd216c
--- /dev/null
+++ b/library/panic_unwind/src/dummy.rs
@@ -0,0 +1,15 @@
+//! Unwinding for unsupported target.
+//!
+//! Stubs that simply abort for targets that don't support unwinding otherwise.
+
+use alloc::boxed::Box;
+use core::any::Any;
+use core::intrinsics;
+
+pub unsafe fn cleanup(_ptr: *mut u8) -> Box<dyn Any + Send> {
+ intrinsics::abort()
+}
+
+pub unsafe fn panic(_data: Box<dyn Any + Send>) -> u32 {
+ intrinsics::abort()
+}