Skip to content

Commit

Permalink
Rollup merge of rust-lang#115111 - ozkanonur:check-rust-analyzer-if-e…
Browse files Browse the repository at this point in the history
…nabled, r=Mark-Simulacrum

compile rust-anaylzer with `x check` if it's enabled

By default, `x check` doesn't compile the rust-analyzer. But when it's enabled in the config's tools section, there's no reason not to do it. This change allows `x check` to compile rust-analyzer if it's enabled in config's tools section.

Helps to rust-lang#115031
  • Loading branch information
matthiaskrgr authored Aug 27, 2023
2 parents fd5a8e1 + 76c2316 commit ab1123b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,17 @@ pub struct RustAnalyzer {
impl Step for RustAnalyzer {
type Output = ();
const ONLY_HOSTS: bool = true;
const DEFAULT: bool = false;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/rust-analyzer")
let builder = run.builder;
run.path("src/tools/rust-analyzer").default_condition(
builder
.config
.tools
.as_ref()
.map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
)
}

fn make_run(run: RunConfig<'_>) {
Expand Down

0 comments on commit ab1123b

Please sign in to comment.