#ownership

8 articles about ownership

rustMarch 31, 2026

What is &mut *x (reborrow) in Rust, and why does it freeze the original reference?

A reborrow duplicates the reference, not the data, and freezes the original for its duration. What &mut *x really does.

rustAugust 10, 2025

Mutable vs. immutable borrows: the two rules

The two borrowing rules, why exclusivity is the one that matters, and what the borrow checker actually rejects.

rustAugust 5, 2025

What is the purpose of Box<T> in Rust?

What Box<T> is for, what the extra indirection costs, and when a heap allocation is the right call rather than a reflex.

rustAugust 4, 2025

Why &str Won't Fit &String in Rust: Fun Fixes for String Mismatches!

Why passing a &str where a &String is expected fails to compile, what deref coercion does and doesn't do, and how to fix the mismatch.

rustAugust 3, 2025

How does Rust prevent dangling pointer at compile time?

Why a dangling pointer is a compile error in Rust rather than a crash in production, and how lifetimes make that check possible.

rustAugust 2, 2025

How does ownership prevent memory leaks and data races?

How the ownership rules close off memory leaks and data races before the program ever runs, and where they stop short.

rustJuly 31, 2025

How does Rust ensure memory safety without a garbage collector?

Ownership, borrowing and lifetimes give Rust memory safety at compile time, with no collector and no runtime pauses to budget for.

rustApril 12, 2025

Rust: Memory Safety Without Garbage Collection

Rust gives you the performance of C with memory safety enforced at compile time. Learn how ownership and borrowing eliminate entire bug classes.