Skip to content
Opensource internals
  • Posts

Rust

Why rustc's GVN Refuses to Merge Two Borrows: Provenance as a Type

Oct 21, 2026 7 min read Jay Hubbert

GVN in rustc gives every borrow a unique provenance marker whose hash and equality implementations panic, so the compiler cannot accidentally merge two pointers.

RustInternalsCompilerMirOptimizationPerformance

Read more →

rustc's Trait Solver Doesn't Write Error Messages: It Writes Proof Trees

Oct 21, 2026 6 min read Jay Hubbert

rustc’s next-gen trait solver never constructs error messages while solving; it records a proof tree and replays it later, with caches bypassed, to find the real cause of a …

RustInternalsCompilerTrait solverDiagnosticsPerformance

Read more →

Divide by Four: How rustc's Trait Solver Makes Itself Stop

Oct 21, 2026 6 min read Jay Hubbert

rustc’s next-gen trait solver normally decrements its recursion budget by one, but after an overflow it divides the budget by four, so the solver terminates almost immediately …

RustInternalsCompilerTrait solverPerformance

Read more →

Coinduction for Free: The Three-Value Lattice That Makes rustc's Trait Solver Terminate

Oct 21, 2026 8 min read Jay Hubbert

The new trait solver’s PathKind lattice (Inductive < Unknown < Coinductive) is joined with a max-like operation, so a cycle’s kind is recomputed compositionally on every stack …

RustInternalsCompilerTrait solverAlgorithms

Read more →

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 →

← Newer Page 6 of 8 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·