Questions about `&mut T` and move semantics, `&mut T` is "move-only"?

Moves are enabled because sometimes you really do need to move the reference and keep its lifetime the same. This can't be done with reborrows.

You can think of reborrows as the following coercion.

let orig:             &'a mut T = ...;
let borrow:   &'b mut &'a mut T = &mut orig;
let reborrow: &'b mut         T = borrow

Notice how the reborrow can't have the same lifetime as the original reference

1 Like