rust/library
bors 8205e6b75e Auto merge of #148291 - purplesyringa:move-throw-to-unwind, r=bjorn3
Move wasm `throw` intrinsic back to `unwind`

Fixes rust-lang/rust#148246, less invasive than the previously proposed rust-lang/rust#148269. Removes the publicly visible unstable intrinsic tracked in rust-lang/rust#122465 since it's not clear how to export it in a sound manner.

r? `@bjorn3`

---

rustc assumes that regular `extern "Rust"` functions unwind only if the `unwind` panic runtime is linked. `throw` was annotated as such, but unwound unconditionally. This could cause UB when a crate built with `-C panic=abort` called `throw` from `core` built with `-C panic=unwind`, since no terminator was added to handle the panic arising from calling an allegedly non-unwinding `extern "Rust"` function.

rustc was taught to recognize this condition since https://github.com/rust-lang/rust/pull/144225 and prevented such linkage, but this caused regressions in
https://github.com/rust-lang/rust/issues/148246, since this meant that Emscripten projects could not be built with `-C panic=abort` without recompiling std.

The most straightforward solution would be to move `throw` into the `panic_unwind` crate, so that it's only compiled if the panic runtime is guaranteed to be `unwind`, but this is messy due to our architecture. Instead, move it into `unwind::wasm`, which is only compiled for bare-metal targets that default to `panic = "abort"`, rendering the issue moot.
2025-10-30 13:17:11 +00:00
..
alloc Rollup merge of #138217 - theemathas:cow_is_owned_borrowed_associated, r=dtolnay 2025-10-30 02:43:41 -04:00
alloctests Rollup merge of #138217 - theemathas:cow_is_owned_borrowed_associated, r=dtolnay 2025-10-30 02:43:41 -04:00
backtrace@b65ab935fb Update the backtrace submodule 2025-06-16 07:00:13 +00:00
compiler-builtins Mark float intrinsics with no preconditions as safe 2025-09-21 20:37:51 -04:00
core Auto merge of #148093 - Azzybana:master, r=nnethercote 2025-10-29 15:37:05 +00:00
coretests const select_unpredictable 2025-10-26 21:33:00 -04:00
panic_abort Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
panic_unwind Migrate panic_unwind to use cfg_select! 2025-08-20 16:45:24 -07:00
portable-simd docs(std): add missing closing code block fences in doc comments 2025-09-02 22:11:29 +02:00
proc_macro Update CURRENT_RUSTC_VERSION post-bump 2025-10-28 13:22:00 -07: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 Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
rustc-std-workspace-core Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
rustc-std-workspace-std Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
std Update CURRENT_RUSTC_VERSION post-bump 2025-10-28 13:22:00 -07:00
std_detect std_detect Darwin AArch64: synchronize features 2025-09-13 23:29:55 -07:00
stdarch Move wasm throw intrinsic back to unwind 2025-10-30 15:13:32 +03:00
sysroot Add panic=immediate-abort 2025-09-21 13:12:18 -04:00
test Rollup merge of #142807 - sourcefrog:failfast, r=dtolnay 2025-09-17 14:56:41 +10:00
unwind Move wasm throw intrinsic back to unwind 2025-10-30 15:13:32 +03:00
windows_targets Rollup merge of #144399 - bjorn3:stdlib_tests_separate_packages, r=Mark-Simulacrum 2025-07-28 08:36:53 +02:00
Cargo.lock Rollup merge of #147000 - moturus:motor-os_stdlib_pr, r=tgross35 2025-10-16 19:35:23 +02:00
Cargo.toml Remove the std workspace patch for compiler-builtins 2025-08-19 18:56:35 +00:00