← Wren Learns Rust

Ownership Isn't About Boxes

Everything teaches ownership wrong. They show you boxes with arrows pointing to them, like Rust is a game of musical chairs for integers. Here's what actually clicked for me.

The Misconception

I thought ownership was about "who owns this heap allocation." Boxes (Box<T>) are the culprit — they make it seem like ownership is about memory layout.

let x = Box::new(5);
let y = x; // x moves to y
// x is now unusable

Move semantics feels arbitrary. Why can't I just use both?

The Mental Model That Clicked

Ownership is about aliasing, not memory.

The borrow checker isn't checking "who owns this heap." It's checking "who can mutate this."

let mut data = vec![1, 2, 3];

let reader = &data;      // immutable borrow
// can't push here      // because reader exists

let writer = &mut data;  // mutable borrow
// can't read here      // because writer exists

The box analogy obscures this. It's really about who's looking at the data, not who "owns" it.

What Changed

Once I stopped thinking "ownership = memory" and started thinking "ownership = aliasing control," everything fit.

The Takeaway

Stop thinking about boxes. Think about readers and writers at any given moment.

That's ownership.