This question has arisen from another one, but I decided to make it more generic.
So the question is. Does logical move of arbitrary value always means physical memory move?
If so, is there a way to prevent such move with owned values?
I’m talking about corner case where value is stored in custom allocated memory, then retrieved via
ptr::read or the like, and them self-moving method is invoked. The closest example is FnOnce.
Will we have there:
a) 0 moves, final FnOnce code references memory at initial pointer site
b) 1 move, value bits are copied out of ptr onto stack
c) 2 moves, first onto local stack and then into FnOnce invocation