Closed
Description
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.