about summary refs log tree commit diff
path: root/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/allocator/no_std-alloc-error-handler-custom.rs')
-rw-r--r--src/test/ui/allocator/no_std-alloc-error-handler-custom.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs b/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
index 4d40c7d0d22..c9b4abbfd3f 100644
--- a/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
+++ b/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
@@ -7,7 +7,7 @@
 // compile-flags:-C panic=abort
 // aux-build:helper.rs
 
-#![feature(start, rustc_private, new_uninit, panic_info_message)]
+#![feature(start, rustc_private, new_uninit, panic_info_message, lang_items)]
 #![feature(alloc_error_handler)]
 #![no_std]
 
@@ -84,6 +84,13 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
     }
 }
 
+// Because we are compiling this code with `-C panic=abort`, this wouldn't normally be needed.
+// However, `core` and `alloc` are both compiled with `-C panic=unwind`, which means that functions
+// in these libaries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
+// unwind. So, for this test case we will define the symbol.
+#[lang = "eh_personality"]
+extern fn rust_eh_personality() {}
+
 #[derive(Debug)]
 struct Page([[u64; 32]; 16]);