Skip to content

Commit

Permalink
bootstrap: simplify setting unstable-options for tools
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
onur-ozkan committed Nov 12, 2023
1 parent 1db4b12 commit b1afb6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,6 @@ macro_rules! tool_check_step {
cargo.arg("--all-targets");
}

// Enable internal lints for clippy and rustdoc
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
cargo.rustflag("-Zunstable-options");
let _guard = builder.msg_check(&concat!(stringify!($name), " artifacts").to_lowercase(), target);
run_cargo(
builder,
Expand Down
10 changes: 10 additions & 0 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ pub fn prepare_tool_cargo(
if !features.is_empty() {
cargo.arg("--features").arg(&features.join(", "));
}

// Enable internal lints for clippy and rustdoc
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
//
// NOTE: We unconditionally set this here to avoid recompiling tools between `x check $tool`
// and `x test $tool` executions.
// See https://github.com/rust-lang/rust/issues/116538
cargo.rustflag("-Zunstable-options");

cargo
}

Expand Down

0 comments on commit b1afb6c

Please sign in to comment.