@@ -952,9 +952,24 @@ fn insert_lllocals<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
952952 Lvalue :: new ( "_match::insert_lllocals" ) ,
953953 TrByMoveIntoCopy ( ..) => {
954954 // match_input moves from the input into a
955- // separate stack slot; it must zero (at least
956- // until we track drop flags for a fragmented
957- // parent match input expression).
955+ // separate stack slot.
956+ //
957+ // E.g. consider moving the value `D(A)` out
958+ // of the tuple `(D(A), D(B))` and into the
959+ // local variable `x` via the pattern `(x,_)`,
960+ // leaving the remainder of the tuple `(_,
961+ // D(B))` still to be dropped in the future.
962+ //
963+ // Thus, here we must must zero the place that
964+ // we are moving *from*, because we do not yet
965+ // track drop flags for a fragmented parent
966+ // match input expression.
967+ //
968+ // Longer term we will be able to map the move
969+ // into `(x, _)` up to the parent path that
970+ // owns the whole tuple, and mark the
971+ // corresponding stack-local drop-flag
972+ // tracking the first component of the tuple.
958973 let hint_kind = HintKind :: ZeroAndMaintain ;
959974 Lvalue :: new_with_hint ( "_match::insert_lllocals (match_input)" ,
960975 bcx, binding_info. id , hint_kind)
0 commit comments