I think your example omits too much to express your concern. The
n: usize will just be copied, so that’s fine, but if you had grabbed a reference instead you wouldn’t be allowed to call the
&mut self method.
I’m also not sure what you think
do_dirty_stuff could do to “deallocate *self” at all. You can’t move out of a reference, and you can’t manually call
Drop. You could
ptr::read it out, but that’s
unsafe for a reason – even without your explicit use, it would face a double-drop problem.