Rust lets you split a borrow into its component fields. You can't pass the original struct while the fields are borrowed, but you can do what you want with the members separately.
No self in foo() is a mutable reference; just the same as r.
Neither self or r have been borrowed from themself and so the next expression allows their use.