about summary refs log tree commit diff
path: root/library/alloc
diff options
context:
space:
mode:
authorDaniel Paoliello <danpao@microsoft.com>2025-07-03 09:17:48 -0700
committerDaniel Paoliello <danpao@microsoft.com>2025-07-03 10:52:21 -0700
commit2b22d0f0d2b9d0d71025065db93058e34f846600 (patch)
tree7896a68c2fe3f42137bd4bce543c24aa2017f8df /library/alloc
parentb94bd12401d26ccf1c3b04ceb4e950b0ff7c8d29 (diff)
downloadrust-2b22d0f0d2b9d0d71025065db93058e34f846600.tar.gz
rust-2b22d0f0d2b9d0d71025065db93058e34f846600.zip
Make __rust_alloc_error_handler_should_panic a function
Diffstat (limited to 'library/alloc')
-rw-r--r--library/alloc/src/alloc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index b4176e9c1f4..c9b98fa4e5a 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -429,10 +429,10 @@ pub mod __alloc_error_handler {
             // This symbol is emitted by rustc next to __rust_alloc_error_handler.
             // Its value depends on the -Zoom={panic,abort} compiler option.
             #[rustc_std_internal_symbol]
-            static __rust_alloc_error_handler_should_panic: u8;
+            fn __rust_alloc_error_handler_should_panic_v2() -> u8;
         }
 
-        if unsafe { __rust_alloc_error_handler_should_panic != 0 } {
+        if unsafe { __rust_alloc_error_handler_should_panic_v2() != 0 } {
             panic!("memory allocation of {size} bytes failed")
         } else {
             core::panicking::panic_nounwind_fmt(