rust/compiler/rustc_middle/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
..
dep_graph Make DefPathHash->DefId panic for if the mapping fails. 2021-09-14 13:56:33 +02:00
hir Rollup merge of #89078 - camsteffen:map-ref, r=cjgillot 2021-09-21 22:54:00 +02:00
ich Auto merge of #89016 - lcnr:non_blanket_impls, r=nikomatsakis,michaelwoerister 2021-09-23 15:44:53 +00:00
infer Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
middle Adjust documentation for compatibility with 2021 2021-09-20 22:21:43 -04:00
mir Auto merge of #89030 - nbdd0121:box2, r=jonas-schievink 2021-09-25 11:01:13 +00:00
query Fix typo 2021-09-23 18:57:23 +09:00
thir add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
traits use indexmap instead of hashmap 2021-09-21 08:24:23 +02:00
ty Rollup merge of #89001 - jackh726:binder-cleanup, r=nikomatsakis 2021-09-24 11:40:11 -07:00
util Make panic/assert calls in rustc compatible with Rust 2021. 2021-02-03 22:42:53 +01:00
arena.rs ty::layout: intern FnAbis as &'tcx. 2021-09-18 01:42:45 +03:00
lib.rs Gather module items after lowering. 2021-09-12 16:33:16 +02:00
lint.rs Fix #88256, remove duplicated diagnostic 2021-09-04 19:26:25 +08:00
macros.rs Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
tests.rs
thir.rs rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00