about summary refs log tree commit diff
path: root/tests/ui/allocator/no_std-alloc-error-handler-default.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-06-24 09:03:16 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-06-24 09:06:49 +0000
commitfcb718b25fbda2bec2255babe212654ba2f4e8c9 (patch)
treef28bdb57f4e5383cd9ed7edde55a0eba9de6e779 /tests/ui/allocator/no_std-alloc-error-handler-default.rs
parent77232fb9350dbe09821df27f184301475829f1e4 (diff)
downloadrust-fcb718b25fbda2bec2255babe212654ba2f4e8c9.tar.gz
rust-fcb718b25fbda2bec2255babe212654ba2f4e8c9.zip
Fix function signature for rust_eh_personality
While cg_llvm is very lax about mismatched function signatures, cg_clif
will crash when there is any mismatch. It could be turned into an error,
but without Cranelift changes can't just be ignored.
Diffstat (limited to 'tests/ui/allocator/no_std-alloc-error-handler-default.rs')
-rw-r--r--tests/ui/allocator/no_std-alloc-error-handler-default.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/ui/allocator/no_std-alloc-error-handler-default.rs b/tests/ui/allocator/no_std-alloc-error-handler-default.rs
index 8bcf054ac85..b9289d9fb81 100644
--- a/tests/ui/allocator/no_std-alloc-error-handler-default.rs
+++ b/tests/ui/allocator/no_std-alloc-error-handler-default.rs
@@ -57,7 +57,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
 // in these libraries 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 "C" fn rust_eh_personality() {}
+extern "C" fn rust_eh_personality(
+    _version: i32,
+    _actions: i32,
+    _exception_class: u64,
+    _exception_object: *mut (),
+    _context: *mut (),
+) -> i32 {
+    loop {}
+}
 
 #[derive(Default, Debug)]
 struct Page(#[allow(dead_code)] [[u64; 32]; 16]);