If you replace the print statements, it works. The problem was that you can't borrow s var as an immutable while it is being borrowed by r1 var as mutable.
// ** this compiles ** //println!("{}",s); println!("{}",r1); println!("{}",s);