about summary refs log tree commit diff
path: root/library/std/src/alloc.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-04 14:37:30 +0000
committerbors <bors@rust-lang.org>2025-07-04 14:37:30 +0000
commit0c4fa2690de945f062668acfc36b3f8cfbd013e2 (patch)
tree2e57f7883dc3c6de58c406d64b53638140e19a16 /library/std/src/alloc.rs
parent556d20a834126d2d0ac20743b9792b8474d6d03c (diff)
parent3a5da6c4d82a9d7d191ff8d2bfbd8350487ad855 (diff)
downloadrust-0c4fa2690de945f062668acfc36b3f8cfbd013e2.tar.gz
rust-0c4fa2690de945f062668acfc36b3f8cfbd013e2.zip
Auto merge of #143434 - matthiaskrgr:rollup-eyr4rcb, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#140643 (Refactor StableMIR)
 - rust-lang/rust#143286 (Make -Ztrack-diagnostics emit like a note)
 - rust-lang/rust#143308 (Remove `PointerLike` trait)
 - rust-lang/rust#143387 (Make __rust_alloc_error_handler_should_panic a function)
 - rust-lang/rust#143400 (Port `#[rustc_pass_by_value]` to the new attribute system)
 - rust-lang/rust#143417 (bump termize dep)
 - rust-lang/rust#143420 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/alloc.rs')
-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.