Skip to main content
v0.14.0

A field cannot be moved out of a Drop type, even where its destructor would not need it

Gap​

The Language Spec bans moving a field out of a Drop type unconditionally (legality-2), so a destructor never runs against a value whose fields have been narrowed away. RFC-0137 §5 replaces the ban with row-bounded Drop dispatch: a Drop impl's required field set is the residual row its drop receiver declares, and a move is allowed when the remaining row still covers it. That needs the narrowed drop receiver (RFC-0109). The section "Drop dispatch against a narrowed residual" specifies the mechanism; until it is built the ban is enforced exactly as stated.

Impact​

Code that wants to take one field of a Drop type and let the rest be dropped later must restructure, for example by moving the whole value.

Affects​

Resolution​

Planned for v0.16.0, tracked as metel-core#949 (RFC-0137 §5).