Why did compiler not error on this mutable borrow when there is an immutable borrowed string slice reference still in scope?
问题 I am learning Rust from The Rust Programming Language book available from No Starch Press but ran into an issue where the compiler did not behave as explained in the book in chapter 4 on p. 77. Chapter 4 of the book is discussing ownership, and the example on p. 77 is similar to this without the final println!() in main() (I've also added comments and the function from p. 76 to create an MCVE). I also created a playground. fn main() { let mut s = String::from("Hello world!"); let word = first