An immutable reference is read-only access to a value. Rust permits multiple immutable references, but prevents them from overlapping with a mutable reference; the borrow checker validates these rules at compile time. section 1.2.1
Use immutable references to reason about safety and data movement:
- Treat multiple immutable references as compatible shared reads; Rust rejects simultaneous shared mutable access. section 1.2.1
- Inspect function signatures: a reference input returning a slice or reference is unlikely to copy, while an owned return may create one. section 5.4
- Verify uncertain behavior in documentation and source code, especially when performance depends on copying versus in-place mutation. section 5.4
Read-only input versus in-place mutation
The signatures `fn func(&self) -> &str` and `fn func(&mut self)` communicate different costs and permissions: the first commonly returns borrowed data without copying, while the second may modify data in place. In contrast, `to_lowercase(&self) -> String` returns a new owned string; `make_ascii_lowercase(&mut self)` changes the existing string. section 5.4
Use the borrow-checker diagram to compare the allowed combinations of immutable and mutable references. section 1.2.1


