diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2023-01-08 11:42:00 -0500 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2023-01-08 11:42:00 -0500 |
| commit | 70659f7591b9ecc4a92df9d45c1d18e750a5339b (patch) | |
| tree | b9859462cbd11afa2d9edb51446ac802a201d311 /example | |
| parent | a4b74e3adf214d985c541eb7d005bb77e59338f5 (diff) | |
| download | rust-70659f7591b9ecc4a92df9d45c1d18e750a5339b.tar.gz rust-70659f7591b9ecc4a92df9d45c1d18e750a5339b.zip | |
Cleanup
Diffstat (limited to 'example')
| -rw-r--r-- | example/alloc_example.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/example/alloc_example.rs b/example/alloc_example.rs index c327b93f1bb..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; @@ -26,6 +26,16 @@ fn alloc_error_handler(_: alloc::alloc::Layout) -> ! { core::intrinsics::abort(); } +#[lang = "eh_personality"] +fn eh_personality() -> ! { + loop {} +} + +#[no_mangle] +unsafe extern "C" fn _Unwind_Resume() { + core::intrinsics::unreachable(); +} + #[start] fn main(_argc: isize, _argv: *const *const u8) -> isize { let world: Box<&str> = box "Hello World!\0"; |
