about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-01-04 11:02:20 +0100
committerLukas Wirth <lukastw97@gmail.com>2024-01-04 11:02:20 +0100
commit7b41008ee03cf805ea888e5d3063de7b093eb302 (patch)
tree2dad3a89ad5f316bf19d34ed73d37ce3b2a167da /src
parent090d5eac722000906cc00d991f2bf052b0e388c3 (diff)
downloadrust-7b41008ee03cf805ea888e5d3063de7b093eb302.tar.gz
rust-7b41008ee03cf805ea888e5d3063de7b093eb302.zip
Set the `in-rust-tree`` feature for all rust-analyzer{-proc-macro-srv} steps
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/check.rs2
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs2
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs6
-rw-r--r--src/tools/rust-analyzer/crates/mbe/Cargo.toml5
-rw-r--r--src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml2
-rw-r--r--src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml5
-rw-r--r--src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs3
7 files changed, 16 insertions, 9 deletions
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
index ecaaf91aec1..f1f2f28909d 100644
--- a/src/bootstrap/src/core/build_steps/check.rs
+++ b/src/bootstrap/src/core/build_steps/check.rs
@@ -386,7 +386,7 @@ impl Step for RustAnalyzer {
             cargo_subcommand(builder.kind),
             "src/tools/rust-analyzer",
             SourceType::InTree,
-            &["rust-analyzer/in-rust-tree".to_owned()],
+            &["in-rust-tree".to_owned()],
         );
 
         cargo.allow_features(crate::core::build_steps::tool::RustAnalyzer::ALLOW_FEATURES);
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 92140b00da8..0f5ed1ceabd 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -385,7 +385,7 @@ impl Step for RustAnalyzer {
             "test",
             crate_path,
             SourceType::InTree,
-            &["sysroot-abi".to_owned()],
+            &["sysroot-abi".to_owned(), "in-rust-tree".to_owned()],
         );
         cargo.allow_features(tool::RustAnalyzer::ALLOW_FEATURES);
 
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 8a9197d75d7..6c3f1b359c0 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -628,7 +628,7 @@ impl Step for RustAnalyzer {
             tool: "rust-analyzer",
             mode: Mode::ToolRustc,
             path: "src/tools/rust-analyzer",
-            extra_features: vec!["rust-analyzer/in-rust-tree".to_owned()],
+            extra_features: vec!["in-rust-tree".to_owned()],
             source_type: SourceType::InTree,
             allow_features: RustAnalyzer::ALLOW_FEATURES,
         })
@@ -673,9 +673,9 @@ impl Step for RustAnalyzerProcMacroSrv {
             compiler: self.compiler,
             target: self.target,
             tool: "rust-analyzer-proc-macro-srv",
-            mode: Mode::ToolStd,
+            mode: Mode::ToolRustc,
             path: "src/tools/rust-analyzer/crates/proc-macro-srv-cli",
-            extra_features: vec!["sysroot-abi".to_owned()],
+            extra_features: vec!["sysroot-abi".to_owned(), "in-rust-tree".to_owned()],
             source_type: SourceType::InTree,
             allow_features: RustAnalyzer::ALLOW_FEATURES,
         });
diff --git a/src/tools/rust-analyzer/crates/mbe/Cargo.toml b/src/tools/rust-analyzer/crates/mbe/Cargo.toml
index f50d796e139..2046fa943a8 100644
--- a/src/tools/rust-analyzer/crates/mbe/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/mbe/Cargo.toml
@@ -27,5 +27,8 @@ span.workspace = true
 [dev-dependencies]
 test-utils.workspace = true
 
+[features]
+in-rust-tree = ["parser/in-rust-tree", "syntax/in-rust-tree"]
+
 [lints]
-workspace = true
\ No newline at end of file
+workspace = true
diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml b/src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml
index 980eab2696b..b9e4e534924 100644
--- a/src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml
@@ -14,6 +14,8 @@ proc-macro-api.workspace = true
 
 [features]
 sysroot-abi = ["proc-macro-srv/sysroot-abi"]
+in-rust-tree = ["proc-macro-srv/in-rust-tree"]
+
 
 [[bin]]
 name = "rust-analyzer-proc-macro-srv"
diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml b/src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml
index b6686fa5b65..54dae4eba96 100644
--- a/src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml
@@ -37,7 +37,8 @@ expect-test = "1.4.0"
 proc-macro-test.path = "./proc-macro-test"
 
 [features]
-sysroot-abi = ["proc-macro-test/sysroot-abi"]
+sysroot-abi = []
+in-rust-tree = ["mbe/in-rust-tree"]
 
 [lints]
-workspace = true
\ No newline at end of file
+workspace = true
diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs
index 7cd6df2df86..f1575a5b0bd 100644
--- a/src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs
@@ -11,11 +11,12 @@
 //!   rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)…
 
 #![cfg(any(feature = "sysroot-abi", rust_analyzer))]
-#![feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span)]
+#![feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span, rustc_private)]
 #![warn(rust_2018_idioms, unused_lifetimes)]
 #![allow(unreachable_pub, internal_features)]
 
 extern crate proc_macro;
+extern crate rustc_driver as _;
 
 mod dylib;
 mod server;