Function rustc_mir_transform::copy_prop::fully_moved_locals

source ·
fn fully_moved_locals(ssa: &SsaLocals, body: &Body<'_>) -> BitSet<Local>
Expand description

SsaLocals computed equivalence classes between locals considering copy/move assignments.

This function also returns whether all the move? in the pattern are move and not copies. A local which is in the bitset can be replaced by move _a. Otherwise, it must be replaced by copy _a, as we cannot move multiple times from _a.

If an operand copies _c, it must happen before the assignment _d = _c, otherwise it is UB. This means that replacing it by a copy of _a if ok, since this copy happens before _c is moved, and therefore that _d is moved.