rust/compiler/rustc_mir_dataflow/src
Manish Goregaokar f71b3e2b46
Rollup merge of #89532 - ecstatic-morse:maybe-live-locals-enum, r=oli-obk,tmiasko
Document behavior of  `MaybeLiveLocals` regarding enums and field-senstivity

This arose from a [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/MaybeLiveLocals.20and.20Discriminants) where a new contributor attempted to implement a dead-store elimination pass using this analysis. They ran into a nasty hack around `SetDiscriminant` the effect of which is to lets handle assignments of literals to enum-typed locals (e.g. `x = Some(4)`) correctly. This took me a while to figure out.

Document this oddity, so the next person will have an easier time, and add a test to enshrine the current behavior.

r? ``@tmiasko``
2021-10-05 12:52:48 -07:00
..
framework
impls Discuss field-sensitivity and enums in context of MaybeLiveLocals 2021-10-04 14:09:19 -07:00
move_paths Replace Fn impls with RPIT impls in rustc_index 2021-10-03 17:50:53 +02:00
drop_flag_effects.rs
elaborate_drops.rs
lib.rs Stabilize const_panic 2021-10-04 02:33:33 -04:00
rustc_peek.rs
storage.rs