Closed
Description
This would mean derived clone implementations can reuse the resources of interior types (especially important with types containing things like Vec
) when cloning into an already-created instance.
Currently doing this is difficult with how #[deriving]
works internally (needs a mutable borrow of the contents of self
, and needs to avoid borrowing self
for enum variants that mismatch or else the requisite *self = other.clone()
implementation won't work).