Skip to content

Commit b1afb6c

Browse files
committed
bootstrap: simplify setting unstable-options for tools
We unconditionally set this to avoid recompiling tools between `x check $tool` and `x test $tool` executions. See rust-lang#116538 for more information. Signed-off-by: onur-ozkan <[email protected]>
1 parent 1db4b12 commit b1afb6c

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)