diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-08-06 15:20:15 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2025-08-06 15:20:15 +0200 |
| commit | 057df26bae7bd2f6c572462684302ea58c8fbdef (patch) | |
| tree | 59937f15444a1924e3f0756b2768f333c13a30ff /src/bootstrap | |
| parent | dc0bae1db725fbba8524f195f74f680995fd549e (diff) | |
| download | rust-057df26bae7bd2f6c572462684302ea58c8fbdef.tar.gz rust-057df26bae7bd2f6c572462684302ea58c8fbdef.zip | |
Remove unneeded `stage` parameter when setting up stdlib Cargo
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/check.rs | 4 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/clippy.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/compile.rs | 12 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/doc.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/test.rs | 2 |
5 files changed, 9 insertions, 13 deletions
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index f6653ed899b..f931aae3c2e 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -84,7 +84,7 @@ impl Step for Std { Kind::Check, ); - std_cargo(builder, target, stage, &mut cargo); + std_cargo(builder, target, &mut cargo); if matches!(builder.config.cmd, Subcommand::Fix) { // By default, cargo tries to fix all targets. Tell it not to fix tests until we've added `test` to the sysroot. cargo.arg("--lib"); @@ -125,7 +125,7 @@ impl Step for Std { Kind::Check, ); - std_cargo(builder, target, build_compiler.stage, &mut cargo); + std_cargo(builder, target, &mut cargo); // Explicitly pass -p for all dependencies krates -- this will force cargo // to also check the tests/benches/examples for these crates, rather diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs index b119f2dc3ce..93c767bdd25 100644 --- a/src/bootstrap/src/core/build_steps/clippy.rs +++ b/src/bootstrap/src/core/build_steps/clippy.rs @@ -154,7 +154,7 @@ impl Step for Std { Kind::Clippy, ); - std_cargo(builder, target, compiler.stage, &mut cargo); + std_cargo(builder, target, &mut cargo); for krate in &*self.crates { cargo.arg("-p").arg(krate); diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 95707e37018..7039f31cdde 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -269,7 +269,7 @@ impl Step for Std { target, Kind::Build, ); - std_cargo(builder, target, compiler.stage, &mut cargo); + std_cargo(builder, target, &mut cargo); for krate in &*self.crates { cargo.arg("-p").arg(krate); } @@ -497,7 +497,7 @@ fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf { /// Configure cargo to compile the standard library, adding appropriate env vars /// and such. -pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) { +pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, cargo: &mut Cargo) { // rustc already ensures that it builds with the minimum deployment // target, so ideally we shouldn't need to do anything here. // @@ -645,12 +645,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car // built with bitcode so that the produced rlibs can be used for both LTO // builds (which use bitcode) and non-LTO builds (which use object code). // So we override the override here! - // - // But we don't bother for the stage 0 compiler because it's never used - // with LTO. - if stage >= 1 { - cargo.rustflag("-Cembed-bitcode=yes"); - } + cargo.rustflag("-Cembed-bitcode=yes"); + if builder.config.rust_lto == RustcLto::Off { cargo.rustflag("-Clto=off"); } diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index d4539a0eb34..9f3524905d7 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -722,7 +722,7 @@ fn doc_std( let mut cargo = builder::Cargo::new(builder, compiler, Mode::Std, SourceType::InTree, target, Kind::Doc); - compile::std_cargo(builder, target, compiler.stage, &mut cargo); + compile::std_cargo(builder, target, &mut cargo); cargo .arg("--no-deps") .arg("--target-dir") diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 09d2657b666..b6199c74fb1 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2858,7 +2858,7 @@ impl Step for Crate { .arg("--manifest-path") .arg(builder.src.join("library/sysroot/Cargo.toml")); } else { - compile::std_cargo(builder, target, compiler.stage, &mut cargo); + compile::std_cargo(builder, target, &mut cargo); } } Mode::Rustc => { |
