diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2023-03-05 12:03:19 -0500 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2023-03-05 12:03:19 -0500 |
| commit | d725cfb6abd04691a3e5c91e4f2c0e3860561deb (patch) | |
| tree | 687fcf0017913e058d84314aa788cf19146bfbe8 /example/alloc_example.rs | |
| parent | ea83d6f4d83c53a7da67e995efbaba6ca394903a (diff) | |
| download | rust-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.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] |
