Ownership is Rust’s way of making memory safety checkable instead of hopeful. If you have bounced off it before, the problem is usually not the rules — it is the vocabulary. This post uses plain words.
The three rules #
- Every value has exactly one owner.
- When the owner goes out of scope, the value is dropped.
- You can lend the value out — either to one reader-writer, or to any number of readers.
That is it. Everything else is consequence.
Moves are transfers, not copies #
A move is not a copy — the stack bits of s are not duplicated. The compiler
just marks s as no longer usable and the heap buffer lives on under t.
Copies happen only for types that are cheap and stack-local by definition.
Borrowing is lending #
If moves were the only tool, every function call would eat its arguments. Borrows fix that:
The rules of lending mirror the aliasing rules of the language:
- One
&mutborrow, or - Any number of
&borrows,
…at any moment. This is what eliminates data races at compile time — no locks, no runtime borrow checker, no garbage collector.
Lifetimes are just scopes #
A lifetime annotation like 'a never changes how long anything lives.
It documents a relationship: “this return value borrows from this argument.”
The compiler cannot guess this on its own, because both branches are possible. The annotation is a proof obligation, discharged by the caller.
Where people actually get stuck #
| Symptom | Real cause |
|---|---|
| “Fighting the borrow checker” | State is shared and mutated too broadly |
| Cloning to make errors stop | Ownership boundaries are in the wrong place |
| Lifetime soup | Functions doing too much at once |
In each case the fix is design: shrink the mutable surface, pass data down instead of reaching up, split the function.
Closing thought #
Ownership is not ceremony you pay for performance. It is the reason a Rust binary of this shape can run for years without a use-after-free, and the reason refactoring is not scary. The rules are small; the consequences are deep — which is exactly what you want from a systems language.