diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-03-07 19:57:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 19:57:45 +0100 |
| commit | cbbaebc34c5d33a1965140f7b581499085600e97 (patch) | |
| tree | 6ad27a500119fed5e9e98308c3e423b2de2daa93 /example/alloc_example.rs | |
| parent | 7b85215c4fdc1831e580a1025f433a97740f9b26 (diff) | |
| parent | cf9c2f840f56eda73c7abd79fe3b94117f0926fb (diff) | |
| download | rust-cbbaebc34c5d33a1965140f7b581499085600e97.tar.gz rust-cbbaebc34c5d33a1965140f7b581499085600e97.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 'example/alloc_example.rs')
| -rw-r--r-- | example/alloc_example.rs | 20 |
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] |
