about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/alloc_example.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-07 19:57:45 +0100
committerGitHub <noreply@github.com>2023-03-07 19:57:45 +0100
commitc21a640c5a31d64a276cbb76e9e358623ec0ad17 (patch)
tree85da5a3b9a5b48f906bf78c4bd40f7a40072f4ff /compiler/rustc_codegen_gcc/example/alloc_example.rs
parent63635880f6fe27fc291c7542bc7df03018f694bb (diff)
parent2c0c25dcc1598cd115838e1e1d74d9f32ffd8dbf (diff)
downloadrust-c21a640c5a31d64a276cbb76e9e358623ec0ad17.tar.gz
rust-c21a640c5a31d64a276cbb76e9e358623ec0ad17.zip
Rollup merge of #108783 - antoyo:sync-cg_gcc-2023-03-04, r=cjgillot
Sync rustc_codegen_gcc 2023/03/04

Hi.
This sync all the changes from rustc_codegen_gcc.
Thanks for the review.
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_example.rs')
-rw-r--r--compiler/rustc_codegen_gcc/example/alloc_example.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_gcc/example/alloc_example.rs b/compiler/rustc_codegen_gcc/example/alloc_example.rs
index 74ea7ec4ede..c80348ca549 100644
--- a/compiler/rustc_codegen_gcc/example/alloc_example.rs
+++ b/compiler/rustc_codegen_gcc/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]