Idea · Oct 14, 2026
Build Your Own Borrow Checker
A staged compilers or PL course project where students implement ownership, moves, and borrow checking for a tiny Rust-like language, ending with a fuzzing hunt for unsound programs their own checker wrongly accepts.
What it would do
This week Rust developers reported an 11-year-old borrow-checker unsoundness bug involving the implicit drop at the end of a nested block, a reminder that checkers are programs too. In this project students build one for MiniRust, a small language with structs, references, Box, and explicit scopes. Milestone 1 is a parser and type checker. Milestone 2 adds move semantics and use-after-move errors. Milestone 3 implements lexical lifetimes, then Milestone 4 replaces them with a non-lexical, liveness-based analysis over a control-flow graph (the NLL idea), including implicit drops at scope exit. Milestone 5 is the twist: students write a reference interpreter that detects actual use-after-free at runtime, then fuzz random programs to find cases their static checker accepts but the interpreter catches, and write up each soundness bug like a real compiler issue.
Key features
- Starter parser and pretty-printer for MiniRust so students focus on analysis, not syntax
- Graded test suite of accept/reject programs with expected error spans, in the style of rustc UI tests
- CFG visualizer that shows live borrows and loans at each program point
- Runtime-checking interpreter as a ground-truth oracle for memory safety
- Differential fuzzing milestone with a required soundness-bug report and minimized reproducer