Apply LTO when building rustc tools

This commit is contained in:
Jakub Beránek 2025-04-09 17:47:32 +02:00
parent f06e5c1e35
commit 9a26863acc
No known key found for this signature in database
GPG key ID: 909CD0D26483516B

View file

@ -148,7 +148,9 @@ impl Step for ToolBuild {
&self.extra_features,
);
if path.ends_with("/rustdoc") &&
// Rustc tools (miri, clippy, cargo, rustfmt, rust-analyzer)
// could use the additional optimizations.
if self.mode == Mode::ToolRustc &&
// rustdoc is performance sensitive, so apply LTO to it.
is_lto_stage(&self.compiler)
{