I wrote this code that borrows a mutable variable more than once and compiles without any error, but according to The Rust Programming Language this should not compile:
fn main() {
let mut s = String::from("hello");
println!("{}", s);
test_three(&mut s);
println!("{}", s);
test_three(&mut s);
println!("{}", s);
}
fn test_three(st: &mut String) {
st.push('f');
}
Is this a bug or there is new feature in Rust?