Skip to content

Commit 306d464

Browse files
authored
Unrolled build for rust-lang#117850
Rollup merge of rust-lang#117850 - onur-ozkan:fix-116538, r=Mark-Simulacrum bootstrap: simplify setting unstable-options for tools Previously, we unconditionally(instead of `if path == "src/tools/clippy" || ..`) set this (to prevent recompiling tools between `x check $tool` and '` check $another_tool` executions) specifically for tools in the `x check` step. This PR relocates that logic to `fn prepare_tool_cargo`, making it step-agnostic. Fixes rust-lang#116538 Fixes rust-lang#117983
2 parents 15a791f + b1afb6c commit 306d464

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/bootstrap/src/core/build_steps/check.rs

-4
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,6 @@ macro_rules! tool_check_step {
463463
cargo.arg("--all-targets");
464464
}
465465

466-
// Enable internal lints for clippy and rustdoc
467-
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
468-
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
469-
cargo.rustflag("-Zunstable-options");
470466
let _guard = builder.msg_check(&concat!(stringify!($name), " artifacts").to_lowercase(), target);
471467
run_cargo(
472468
builder,

src/bootstrap/src/core/build_steps/tool.rs

+10
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,16 @@ pub fn prepare_tool_cargo(
203203
if !features.is_empty() {
204204
cargo.arg("--features").arg(&features.join(", "));
205205
}
206+
207+
// Enable internal lints for clippy and rustdoc
208+
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
209+
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
210+
//
211+
// NOTE: We unconditionally set this here to avoid recompiling tools between `x check $tool`
212+
// and `x test $tool` executions.
213+
// See https://github.com/rust-lang/rust/issues/116538
214+
cargo.rustflag("-Zunstable-options");
215+
206216
cargo
207217
}
208218

0 commit comments

Comments
 (0)