about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2023-10-09 11:08:42 -0400
committerAntoni Boucher <bouanto@zoho.com>2023-10-09 11:08:42 -0400
commitad5637468e8cc1e3de1c8b9454dec01ae5b2b60a (patch)
tree34f94a8182704addaec7256defd74aa462c0b7d8
parente7f7fb87ddd9ddfa4c52c6b683a501a9ab3eba8b (diff)
downloadrust-ad5637468e8cc1e3de1c8b9454dec01ae5b2b60a.tar.gz
rust-ad5637468e8cc1e3de1c8b9454dec01ae5b2b60a.zip
Add missing panic_in_cleanup
-rw-r--r--example/mini_core.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs
index 58df29bb625..34328520343 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -429,6 +429,15 @@ fn panic_cannot_unwind() -> ! {
     }
 }
 
+#[lang = "panic_in_cleanup"]
+#[rustc_nounwind]
+fn panic_in_cleanup() -> ! {
+    unsafe {
+        libc::printf("panic in a destructor during cleanup\n\0" as *const str as *const i8);
+        intrinsics::abort();
+    }
+}
+
 #[lang = "panic_bounds_check"]
 #[track_caller]
 fn panic_bounds_check(index: usize, len: usize) -> ! {