impl MyThing{
fn test_borrow(&mut self){
println!("OwO {}", self.name);
}
}
let a = MyThing{...};
a.test_borrow();
In this code, a can't be mutated so the compiler rightly complained to me.
impl Drop for MyThing{
fn drop(&mut self){
println!("Dropping {}", self.name);
}
}
But if I implement Drop for MyThing, the funcitno signature uses "&mut". The compiler didn't complain, and the program actually ran to finished and drop was called.