rust/library/std/src
Alex Crichton 1c07096a45 rustc: Fill out remaining parts of C-unwind ABI
This commit intends to fill out some of the remaining pieces of the
C-unwind ABI. This has a number of other changes with it though to move
this design space forward a bit. Notably contained within here is:

* On `panic=unwind`, the `extern "C"` ABI is now considered as "may
  unwind". This fixes a longstanding soundness issue where if you
  `panic!()` in an `extern "C"` function defined in Rust that's actually
  UB because the LLVM representation for the function has the `nounwind`
  attribute, but then you unwind.

* Whether or not a function unwinds now mainly considers the ABI of the
  function instead of first checking the panic strategy. This fixes a
  miscompile of `extern "C-unwind"` with `panic=abort` because that ABI
  can still unwind.

* The aborting stub for non-unwinding ABIs with `panic=unwind` has been
  reimplemented. Previously this was done as a small tweak during MIR
  generation, but this has been moved to a separate and dedicated MIR
  pass. This new pass will, for appropriate functions and function
  calls, insert a `cleanup` landing pad for any function call that may
  unwind within a function that is itself not allowed to unwind. Note
  that this subtly changes some behavior from before where previously on
  an unwind which was caught-to-abort it would run active destructors in
  the function, and now it simply immediately aborts the process.

* The `#[unwind]` attribute has been removed and all users in tests and
  such are now using `C-unwind` and `#![feature(c_unwind)]`.

I think this is largely the last piece of the RFC to implement.
Unfortunately I believe this is still not stabilizable as-is because
activating the feature gate changes the behavior of the existing `extern
"C"` ABI in a way that has no replacement. My thinking for how to enable
this is that we add support for the `C-unwind` ABI on stable Rust first,
and then after it hits stable we change the behavior of the `C` ABI.
That way anyone straddling stable/beta/nightly can switch to `C-unwind`
safely.
2021-08-03 07:06:19 -07:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Rollup merge of #87330 - inquisitivecrystal:extend-reserve, r=JohnTitor 2021-07-28 18:28:14 +09:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 More lerp tests, altering lerp docs 2021-06-13 14:00:15 -04:00
f64 More lerp tests, altering lerp docs 2021-06-13 14:00:15 -04:00
ffi Remove "length" doc aliases 2021-06-30 20:28:51 +01:00
fs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
io Consistent spelling of "adapter" in the standard library 2021-07-30 17:23:07 +02:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Rollup merge of #87708 - the8472:canonical_v6, r=dtolnay 2021-08-03 19:07:48 +09:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Auto merge of #81825 - voidc:pidfd, r=joshtriplett 2021-08-01 16:45:47 +00:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Refactor parse_prefix on Windows 2020-11-07 16:15:48 +01:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
process Test that env_clear works on Windows 2021-06-24 09:32:24 +01:00
sync Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
sys Rollup merge of #86509 - CDirkx:os_str, r=m-ou-se 2021-08-02 11:03:20 +09:00
sys_common Rollup merge of #86509 - CDirkx:os_str, r=m-ou-se 2021-08-02 11:03:20 +09:00
thread Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
time Duration::zero() -> Duration::ZERO 2020-10-21 20:44:03 -07:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
env.rs Rollup merge of #86183 - inquisitivecrystal:env-nul, r=m-ou-se 2021-08-02 11:03:15 +09:00
error.rs Rollup merge of #82179 - mbartlett21:patch-5, r=joshtriplett 2021-06-15 17:40:03 +09:00
f32.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
f64.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
fs.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
keyword_docs.rs Fix a few misspellings. 2021-06-25 13:18:56 -07:00
lazy.rs Write docs for SyncOnceCell From and Default impl 2021-08-01 14:37:38 -07:00
lib.rs rustc: Fill out remaining parts of C-unwind ABI 2021-08-03 07:06:19 -07:00
macros.rs bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00
num.rs postpone stabilizaton by one release 2021-06-22 10:20:56 +01:00
panic.rs Move UnwindSafe, RefUnwindSafe, AssertUnwindSafe to core 2021-07-30 10:42:15 -07:00
panicking.rs rustc: Fill out remaining parts of C-unwind ABI 2021-08-03 07:06:19 -07:00
path.rs Auto merge of #85747 - maxwase:path-symlinks-methods, r=m-ou-se 2021-06-18 17:13:19 +00:00
primitive_docs.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
process.rs Add Linux-specific pidfd process extensions 2021-07-21 10:49:11 +02:00
rt.rs Change entry point to 🛡️ against 💥 💥-payloads 2021-06-19 11:46:56 +03:00
time.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00