rust/library/alloc/src
bors e9f29a8519 Auto merge of #89030 - nbdd0121:box2, r=jonas-schievink
Introduce `Rvalue::ShallowInitBox`

Polished version of #88700.

Implements MCP rust-lang/compiler-team#460, and should allow #43596 to go forward.

In short, creating an empty box is split from a nullary-op `NullOp::Box` into two steps, first a call to `exchange_malloc`, then a `Rvalue::ShallowInitBox` which transmutes `*mut u8` to a shallow-initialized `Box<T>`. This allows the `exchange_malloc` call to unwind. Details can be found in the MCP.

`NullOp::Box` is not yet removed, purely to make reverting easier in case anything goes wrong as the result of this PR. If revert is needed a reversion of "Use Rvalue::ShallowInitBox for box expression" commit followed by a test bless should be sufficient.

Experiments in #88700 showed a very slight compile-time perf regression due to (supposedly) slightly more time spent in LLVM. We could omit unwind edge generation (in non-`oom=panic` case) in box expression MIR construction to restore perf; but I don't think it's necessary since runtime perf isn't affected and perf difference is rather small.
2021-09-25 11:01:13 +00:00
..
alloc Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
collections unitalicize O(1) complexities 2021-09-24 08:33:49 -05:00
prelude mv std libs to library/ 2020-07-27 19:51:13 -05:00
raw_vec Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
rc Re-stabilize Weak::as_ptr &friends for unsized T 2021-01-06 19:30:22 -05:00
sync Rollup merge of #80764 - CAD97:weak-unsized-as-ptr-again, r=RalfJung 2021-01-16 17:29:56 +00:00
vec Fix missing no_global_oom_handling cfg-gating 2021-09-17 03:53:18 +01:00
alloc.rs Use Rvalue::ShallowInitBox for box expression 2021-09-25 01:08:41 +01:00
borrow.rs Const Deref 2021-09-15 03:06:53 +00:00
boxed.rs Fix missing no_global_oom_handling cfg-gating 2021-09-17 03:53:18 +01:00
fmt.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
lib.rs Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
macros.rs Remove alloc/malloc/calloc/realloc doc aliases 2021-06-30 19:59:39 +01:00
raw_vec.rs Fix a typo in raw_vec 2021-08-28 20:20:22 +02:00
rc.rs Rollup merge of #88226 - steffahn:an_rc, r=michaelwoerister 2021-08-25 15:48:53 +02:00
slice.rs Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
str.rs Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
string.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
sync.rs Make explanations of cross-references between make_mut and get_mut more accurate 2021-08-24 21:34:12 +02:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Fix alloc::test::test_show 2021-04-21 15:45:41 +02:00