Skip to content
Opensource internals
  • Posts

Spans

How a Span Fits in Eight Bytes: rustc's Four-Format Packed Encoding

Oct 21, 2026 6 min read Jay Hubbert

rustc’s Span is 64 bits with four internal layouts selected by a sentinel prefix, decoded by a macro-generated if-chain because the enum version did not optimise.

RustInternalsCompilerPerformanceSpansHygiene

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·