summaryrefslogtreecommitdiff
path: root/Downgrading a mutable reference.md
blob: e1e61a2f9e2f6c5a30afd1808da1d515c0082c76 (plain)
1
2
3
4
5
6
7
8
9
10
[[Creating a reference to a variable is called borrowing]]

---

It can be done:
```rust
let x: i32 = 1; <- R - O
let y: &mut x;  <- R W O
let z: &*y;     <- R - O
```