My understanding is that a volatile borrower can transfer ownership to another volatile borrower. But this move seems a bit different than moving a variable without a pointer. Let's see an example. Below p1moves to p2when compute()called for the first time. But upon return, compute()ownership returns to p1.
fn compute(p2: &mut Point) {
}
fn reset(p1: &mut Point) {
compute(p1);
compute(p1);
}
This is different from how a regular variable moves.
fn compute(p2: Point) {
}
fn reset(p1: Point) {
compute(p1);
compute(p1);
}
Now, ownership does not return to p1after the first call returns compute().
Both behaviors are understandable and desirable for many reasons. But I just wanted to confirm my understanding that these two movements are somewhat different in nature. Do I think so?