Skip to content
Opensource internals
  • Posts

Borrow check

Two-Phase Borrows Are Just Dominator Queries: How `v.push(v.len())` Compiles

Oct 21, 2026 7 min read Jay Hubbert

Two-phase borrows split a mutable borrow into reservation and activation; rustc finds the activation syntactically and answers ‘is it active?’ with O(1) dominator queries instead …

RustInternalsCompilerBorrow checkPerformance

Read more →

No Queue At All: rustc's Dataflow Engine Uses a Bitset and a Rank

Oct 21, 2026 7 min read Jay Hubbert

The rustc dataflow framework replaces the classic worklist with a min-rank dirty bitset over reverse postorder, guaranteeing that loop-free code is analysed in exactly one pass.

RustInternalsCompilerDataflowPerformanceBorrow check

Read more →

The Borrow Checker Blames the Most Interesting Constraint: BFS, Then a Ranking

Oct 21, 2026 5 min read Jay Hubbert

rustc finds the blame for a lifetime error with a breadth-first search for the shortest constraint path, then ranks constraints by how interesting they are for diagnostics and …

RustInternalsCompilerBorrow checkDiagnostics

Read more →

end(X) Doesn't Live in the CFG: How rustc Splits Region Values Into Three Dimensions

Oct 21, 2026 5 min read Jay Hubbert

Instead of encoding end(X) as a fake CFG point, rustc keeps region liveness in three separate dimensions: CFG points, free regions and placeholders, so interval sets stay …

RustInternalsCompilerBorrow checkPerformanceData structures

Read more →

One Pass, No Fixpoint: How rustc Solves Borrow Regions by Condensing Them Into SCCs

Oct 21, 2026 6 min read Jay Hubbert

rustc’s borrow checker solves region constraints in a single pass over an SCC condensation, because regions in a cycle are equal by construction and the condensation is a DAG.

RustInternalsCompilerBorrow checkPerformance

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·