rust/compiler/rustc_mir
bors c0b15cc6ed Auto merge of #77242 - ecstatic-morse:dataflow-switch-int, r=jonas-schievink
Replace `discriminant_switch_effect` with more general version

#68528 added a new edge-specific effect for `SwitchInt` terminators, `discriminant_switch_effect`, to the dataflow framework. While this accomplished the short-term goal of making drop elaboration more precise, it wasn't really useful in other contexts: It only supported `SwitchInt`s on the discriminant of an `enum` and did not allow effects to be applied along the "otherwise" branch. In const-propagation, for example, arbitrary edge-specific effects for the targets of a `SwitchInt` can be used to remember the value a `match` scrutinee must have in each arm.

This PR replaces `discriminant_switch_effect` with a more general `switch_int_edge_effects` method. The new method has a slightly different interface from the other edge-specific effect methods (e.g. `call_return_effect`). This divergence is explained in the new method's documentation, and reading the changes to the various dataflow impls as well as `direction.rs` should further clarify things. This PR should not change behavior.
2020-09-27 21:54:49 +00:00
..
src Auto merge of #77242 - ecstatic-morse:dataflow-switch-int, r=jonas-schievink 2020-09-27 21:54:49 +00:00
Cargo.toml update the version of itertools and parking_lot 2020-09-12 08:26:53 +02:00