I am studying Rust again (after a long pause) and I am following the good Blandy’s Programmin Rust book, at page 118 he shows this example:
let mut y = 20; let m1 = &mut y; ... let z = y; // error: cannot use y because it was mutably borrowed
I cannot understand why Rust complains about usage of
y, the assignment from
z is not a move, since
i32 is a
Copy type. So, since it is just a bit-copy, after the assignment
y are two completely separated things. So why bother about that?