From fbdc749a936e5c8d57083fc662d362d9e13a1ee7 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 24 Sep 2025 10:06:04 -0700 Subject: [PATCH] Make __rust_alloc_error_handler_should_panic a function --- allocator/allocator.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/allocator/allocator.rs b/allocator/allocator.rs index e284e7c..653c382 100644 --- a/allocator/allocator.rs +++ b/allocator/allocator.rs @@ -50,8 +50,9 @@ use alloc::alloc::__alloc_error_handler; #[rustc_std_internal_symbol] #[linkage = "weak"] -#[allow(non_upper_case_globals)] -pub static __rust_alloc_error_handler_should_panic: u8 = 1; +pub unsafe fn __rust_alloc_error_handler_should_panic_v2() -> u8 { + 1 +} #[rustc_std_internal_symbol] #[linkage = "weak"]