fn main() { println!("Hello, world!"); let bb = 5; receiver(&bb); // borrow bb immutably println!("BB1 {bb}"); let mut bb = 5; // for next line to work, bb must be mutable. So redefine bb. What happens to first bb???? mut_receiver(&mut bb); //to allow a mutable borrow, must state explicitly in function that the thing being loaded is mutable. println!("BB2 {bb}"); } // here aa is defined to be mutable. BUT what is mutable? It is the pointer, NOT the value pointed at!!! fn receiver(mut aa:&i32) { println!("{aa}"); aa=&9; println!("{aa}"); } // here we borrow with a mutable pointer. This, we can change the value that is pointed at!! // must to be allow to do that, the function must identify the pointer as being mutable AND // the caller of the function must agree that the thing being borrowed is mutable fn mut_receiver(aa:&mut i32) { println!("{aa}"); *aa=9; println!("{aa}"); }