Open
Description
Currently, it seems like every CGU that contains a &ConcreteType -> &dyn Trait
cast will instantiate the corresponding vtable and drop glue of ConcreteType
. This can result in massive LLVM IR bloat that then slows down compile times.
We have observed this in rust-analyzer (rust-lang/rust-analyzer#10065, also Zulip discussion here), where the drop glue of a single type RootDatabase
is responsible for over 40% of LLVM IR in some downstream crates.