about summary refs log tree commit diff
path: root/example/alloc_example.rs
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2023-03-05 12:03:19 -0500
committerAntoni Boucher <bouanto@zoho.com>2023-03-05 12:03:19 -0500
commitd725cfb6abd04691a3e5c91e4f2c0e3860561deb (patch)
tree687fcf0017913e058d84314aa788cf19146bfbe8 /example/alloc_example.rs
parentea83d6f4d83c53a7da67e995efbaba6ca394903a (diff)
downloadrust-d725cfb6abd04691a3e5c91e4f2c0e3860561deb.tar.gz
rust-d725cfb6abd04691a3e5c91e4f2c0e3860561deb.zip
Merge commit '08a6d6e16b5efe217123e780398969946266268f' into sync-cg_gcc-2023-03-04
Diffstat (limited to 'example/alloc_example.rs')
-rw-r--r--example/alloc_example.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/example/alloc_example.rs b/example/alloc_example.rs
index 74ea7ec4ede..c80348ca549 100644
--- a/example/alloc_example.rs
+++ b/example/alloc_example.rs
@@ -1,4 +1,4 @@
-#![feature(start, box_syntax, core_intrinsics, alloc_error_handler)]
+#![feature(start, box_syntax, core_intrinsics, alloc_error_handler, lang_items)]
 #![no_std]
 
 extern crate alloc;
@@ -18,16 +18,22 @@ extern "C" {
 
 #[panic_handler]
 fn panic_handler(_: &core::panic::PanicInfo) -> ! {
-    unsafe {
-        core::intrinsics::abort();
-    }
+    core::intrinsics::abort();
 }
 
 #[alloc_error_handler]
 fn alloc_error_handler(_: alloc::alloc::Layout) -> ! {
-    unsafe {
-        core::intrinsics::abort();
-    }
+    core::intrinsics::abort();
+}
+
+#[lang = "eh_personality"]
+fn eh_personality() -> ! {
+    loop {}
+}
+
+#[no_mangle]
+unsafe extern "C" fn _Unwind_Resume() {
+    core::intrinsics::unreachable();
 }
 
 #[start]