Don't codegen items that are statically unreachable #104858
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-compiletime
Issue: Problems and improvements with respect to compile times.
Currently, all items in a crate are codegened, and only stripped later in a linker pass:
rust/compiler/rustc_monomorphize/src/partitioning/mod.rs
Lines 201 to 205 in 6c4bda6
rust/compiler/rustc_codegen_ssa/src/back/link.rs
Lines 2179 to 2190 in a24a020
dead_code
pass; we should use its results to avoid running codegen on unreachable items.This is a prerequisite for #103356, but I expect it will be a large boost to compile times even if that never lands.
The text was updated successfully, but these errors were encountered: