about summary refs log tree commit diff
diff options
context:
space:
mode:
authorozkanonur <work@onurozkan.dev>2023-08-22 21:53:08 +0300
committerozkanonur <work@onurozkan.dev>2023-08-22 22:08:04 +0300
commit76c2316ff30795e00a3758ed577daaf3bf9f2354 (patch)
treec3cc470506cc98bc6b307126319a62a01c2870f3
parenta1e1dba9cc40a90409bccb8b19e359c4bdf573e5 (diff)
downloadrust-76c2316ff30795e00a3758ed577daaf3bf9f2354.tar.gz
rust-76c2316ff30795e00a3758ed577daaf3bf9f2354.zip
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.

Signed-off-by: ozkanonur <work@onurozkan.dev>
-rw-r--r--src/bootstrap/check.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index bdefc41c9c7..b417abc00f5 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -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<'_>) {