about summary refs log tree commit diff
path: root/library/std/src
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/std/src
parentb94bd12401d26ccf1c3b04ceb4e950b0ff7c8d29 (diff)
downloadrust-2b22d0f0d2b9d0d71025065db93058e34f846600.tar.gz
rust-2b22d0f0d2b9d0d71025065db93058e34f846600.zip
Make __rust_alloc_error_handler_should_panic a function
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/alloc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/alloc.rs b/library/std/src/alloc.rs
index b574e9f3a25..1d61630269a 100644
--- a/library/std/src/alloc.rs
+++ b/library/std/src/alloc.rs
@@ -349,10 +349,10 @@ fn default_alloc_error_hook(layout: Layout) {
         // 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 {} bytes failed", layout.size());
     } else {
         // This is the default path taken on OOM, and the only path taken on stable with std.