Rust Lifetimes: 'static, Annotations and Elision Rules

Learn how Rust models lifetimes for stack and heap, and how the compiler enforces constraints across function calls. Walk through ‘static vs dynamic lifetimes, lifetime parameters and elision rules, fixing the classic max example, a strtok exercise, and annotating structs—plus when to annotate vs rely on inference.

August 17, 2025 · 11 min · Garry Chen

Rust Borrowing & References: Lifetimes and Borrow Checker

Hands-on guide to Rust borrowing. See how pass-by-value differs from explicit references, when to use read-only vs mutable borrows, and why borrows can’t outlive owners. Includes address demos, lifetimes, and practical fixes for borrow checker errors.

August 9, 2025 · 11 min · Garry Chen