about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-03-31 11:39:03 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-03-31 12:16:33 +0200
commitafe74d71e4c2f08696ade0de321a45f7442440d8 (patch)
tree9591c83a1c0fe521204488e3d25c00e2d6ab03d6 /example
parent5417278438efa00231936bfef3800e75a992f32f (diff)
downloadrust-afe74d71e4c2f08696ade0de321a45f7442440d8.tar.gz
rust-afe74d71e4c2f08696ade0de321a45f7442440d8.zip
Build with `-Cpanic=unwind` by default
This doesn't enable unwinding as cg_clif doesn't support it yet. It does
allow for linking to a cg_llvm compiled libstd.so, which uses
`-Cpanic=unwind`.
Diffstat (limited to 'example')
-rw-r--r--example/alloc_example.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/example/alloc_example.rs b/example/alloc_example.rs
index 71e93e87b6c..b58d90cb5ae 100644
--- a/example/alloc_example.rs
+++ b/example/alloc_example.rs
@@ -1,4 +1,4 @@
-#![feature(start, box_syntax, core_intrinsics, alloc_prelude, alloc_error_handler)]
+#![feature(start, box_syntax, core_intrinsics, alloc_prelude, alloc_error_handler, lang_items)]
 #![no_std]
 
 extern crate alloc;
@@ -27,6 +27,11 @@ fn alloc_error_handler(_: alloc::alloc::Layout) -> ! {
     core::intrinsics::abort();
 }
 
+#[lang = "eh_personality"]
+fn eh_personality() -> ! {
+    loop {}
+}
+
 #[start]
 fn main(_argc: isize, _argv: *const *const u8) -> isize {
     let world: Box<&str> = box "Hello World!\0";