The Rust Borrow Checker: a Deep Dive
summary
Walks through compiler stages (lexer → parser → HIR → MIR → LLVM IR) and shows concrete examples: a moved String that fails at cargo build, the diagnostic text and the one-line fix using a reference that then runs with cargo successfully. Explains how the borrow checker tracks initializations, moves and lifetimes, how spans map MIR nodes back to source, and why borrow rules prevent dangling references while offering actionable compiler guidance.
AI-written summary · about
chapters (15)
- 0:00Start
- 1:27Announcements
- 5:34General Stages to Compiling a Piece of Code
- 6:51Lexical Analysis
- 7:12Parsing
- 9:06Data Structures
- 13:01Mid-Level Intermediate Representation
- 13:55Rust Compiler Semantic Analysis
- 16:54Tracking Initializations and Moves
- 20:15Lifetime Inference
- 23:46Is the Borrow Checker a Friend or a Foe
- 24:31Qa
- 25:04How Do I Get Started Contributing to the Compiler
- 26:35What Do You Think about the Current Attempt To Leverage Gcc To Compile Rust Code
- 36:10Thoughts on Rasta and Zig Collaboration
related talks
53mThe Rust Borrow Checker - A Deep Dive
22mThe Rust Borrow Checker - A Deep Dive
50mRust's Borrow Checker Proven Correct!
27mHow Rust taught me to think about systems
37mCompiler Errors in rustc: A UX Perspective
05mEmulating Rust's Borrow Checker in C++
56mReady for Rust
58m(Almost) Everything You Should Know About The Compiler Frontend
