fn push_val(a: &mut Vec<i32>) {
a.push(3);
}
fn test_mut_ref() {
let mut a = vec![1, 2, 3];
let a_ref = &mut a;
push_val(a_ref); // &mut Vec<i32> doesn't implement Copy trait
a_ref.push(2); // why a_ref still can be used in here?
let a_ref2 = a_ref;
println!("{:?}", a_ref); // borrowed after move error
}
why the last line has an borrowed after move error, but push_val(a_ref); a_ref.push(2) no error?