about summary refs log tree commit diff
path: root/src/librustc_interface/interface.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-05 18:01:47 +0000
committerbors <bors@rust-lang.org>2020-07-05 18:01:47 +0000
commit2753fab7ce3647033146b07c8b6c9f4856a910b0 (patch)
tree02b966b6e169634600bd293df2c5cb5fe21fb44d /src/librustc_interface/interface.rs
parent0cd7ff7ddfb75a38dca81ad3e76b1e984129e939 (diff)
parenteb4d28bce0a73ddbdbcd107dd7875ddd97a603d8 (diff)
downloadrust-2753fab7ce3647033146b07c8b6c9f4856a910b0.tar.gz
rust-2753fab7ce3647033146b07c8b6c9f4856a910b0.zip
Auto merge of #73879 - ecstatic-morse:discr-switch-uninit, r=oli-obk
Handle inactive enum variants in `MaybeUninitializedPlaces`

Resolves the first part of #69715.

This is the equivalent of #68528 but for `MaybeUninitializedPlaces`. Because we now notify drop elaboration that inactive enum variants might be uninitialized, some drops get marked as ["open" that were previously "static"](https://github.com/rust-lang/rust/blob/e0e5d82e1677c82d209b214bbfc2cc5705c2336a/src/librustc_mir/transform/elaborate_drops.rs#L191). Unlike in #69715, this isn't strictly better: An "open" drop expands to more MIR than a simple call to the drop shim. However, because drop elaboration considers each field of an "open" drop separately, it can sometimes eliminate unnecessary drops of moved-from or unit-like enum variants. This is the case for `Option::unwrap`, which is reflected in the `mir-opt` test.

cc @eddyb
r? @oli-obk
Diffstat (limited to 'src/librustc_interface/interface.rs')
0 files changed, 0 insertions, 0 deletions