rust/library
Matthias Krüger 2faf66d091
Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3
Make __rust_alloc_error_handler_should_panic a function

Fixes rust-lang/rust#143253

`__rust_alloc_error_handler_should_panic` is a static but was being exported as a function.

For most targets this doesn't matter, but Arm64EC Windows uses different decorations for exported variables vs functions, hence it fails to link when `-Z oom=abort` is enabled.

We've had issues in the past with statics like this (see rust-lang/rust#141061) but the tldr; is that Arm64EC needs symbols correctly exported as either a function or data, and data MUST and MUST ONLY be marked `dllimport` when the symbol is being imported from another binary, which is non-trivial to calculate for these compiler-generated statics.

So, instead, the easiest thing to do is to make `__rust_alloc_error_handler_should_panic` a function instead.

Since `__rust_alloc_error_handler_should_panic` isn't involved in any linking shenanigans, I've marked it as `AlwaysInline` with the hopes that the various backends will see that it is just returning a constant and perform the same optimizations as the previous implementation.

r? `@bjorn3`
2025-07-04 16:22:36 +02:00
..
alloc Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3 2025-07-04 16:22:36 +02:00
alloctests Rollup merge of #142668 - hkBst:less-static-mut, r=tgross35 2025-06-20 02:50:39 -04:00
backtrace@b65ab935fb Update the backtrace submodule 2025-06-16 07:00:13 +00:00
compiler-builtins Work around out-of-tree testing with a shim crate 2025-06-14 06:56:18 +00:00
core Rollup merge of #143308 - compiler-errors:no-pointer-like, r=oli-obk 2025-07-04 16:22:35 +02:00
coretests Rollup merge of #142749 - LimpSquid:bool_to_result, r=scottmcm 2025-07-04 05:47:22 +02:00
panic_abort Use the in-tree compiler-builtins 2025-06-08 02:36:58 +00:00
panic_unwind Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3 2025-06-09 12:17:53 -05:00
portable-simd Merge commit 'c14f2fc3eb' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
proc_macro Auto merge of #140999 - hkBst:update-escaper, r=nnethercote 2025-06-25 01:03:30 +00:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core make compiler_builtins a private dependency 2025-06-30 20:27:10 -04:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3 2025-07-04 16:22:36 +02:00
stdarch Update README.md 2025-06-29 12:29:28 +03:00
sysroot Avoid exporting panic_unwind as stdlib cargo feature 2025-06-24 19:44:35 +00:00
test Add new test_main_with_exit_callback public function in libtest to allow a callback to be called before exiting 2025-05-06 18:17:48 +02:00
unwind Upgrade the standard library unwinding version 2025-06-11 20:05:06 +00:00
windows_targets Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
Cargo.lock Auto merge of #140999 - hkBst:update-escaper, r=nnethercote 2025-06-25 01:03:30 +00:00
Cargo.toml Auto merge of #140999 - hkBst:update-escaper, r=nnethercote 2025-06-25 01:03:30 +00:00