How rustc Sorts Struct Fields by log2(Size) and Then Hides a Niche
rustc’s field reordering sorts by log2(max(align,size)) to minimise padding, and its enum layout reserves the largest invalid-value hole so Option<&T> is one pointer.
rustc’s field reordering sorts by log2(max(align,size)) to minimise padding, and its enum layout reserves the largest invalid-value hole so Option<&T> is one pointer.
rustc’s CGU partitioning places items by their characteristic DefId and then merges units by inlined-item overlap, which keeps duplicated inlined code to a minimum.
rustc’s monomorphiser divides the recursion depth by four for drop glue only, giving it four times the budget because drop glue is legitimately recursive through the type …
Drop elaboration in rustc classifies each drop as Dead, Static, Conditional or Open using two dataflow analyses; only the Conditional case needs a runtime drop flag, so most drops …
rustc’s MIR inliner computes the call graph from mir_promoted rather than optimized_mir, so the query graph stays acyclic; the result is conservative but never deadlocks.