Understanding of reference life time in Rust
问题 I'm a new Rust user and I'm reading a book The Complete Rust Programming Reference Guide . In the book there is an example: fn main() { let mut a = String::from("testing"); let a_ref = &mut a; a_ref.push('!'); println!("{}", a); } The book states the code will generate an error. However, on my local machine, I can run it without any issue. Is this because I'm using a newer Rust compiler [ rustc 1.41.0-nightly (412f43ac5 2019-11-24) ] and the code doesn't work on older ones? I've read some