Skip to content

Commit 7b41008

Browse files
committed
Set the in-rust-tree` feature for all rust-analyzer{-proc-macro-srv} steps
1 parent 090d5ea commit 7b41008

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

src/bootstrap/src/core/build_steps/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl Step for RustAnalyzer {
386386
cargo_subcommand(builder.kind),
387387
"src/tools/rust-analyzer",
388388
SourceType::InTree,
389-
&["rust-analyzer/in-rust-tree".to_owned()],
389+
&["in-rust-tree".to_owned()],
390390
);
391391

392392
cargo.allow_features(crate::core::build_steps::tool::RustAnalyzer::ALLOW_FEATURES);

src/bootstrap/src/core/build_steps/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl Step for RustAnalyzer {
385385
"test",
386386
crate_path,
387387
SourceType::InTree,
388-
&["sysroot-abi".to_owned()],
388+
&["sysroot-abi".to_owned(), "in-rust-tree".to_owned()],
389389
);
390390
cargo.allow_features(tool::RustAnalyzer::ALLOW_FEATURES);
391391

src/bootstrap/src/core/build_steps/tool.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ impl Step for RustAnalyzer {
628628
tool: "rust-analyzer",
629629
mode: Mode::ToolRustc,
630630
path: "src/tools/rust-analyzer",
631-
extra_features: vec!["rust-analyzer/in-rust-tree".to_owned()],
631+
extra_features: vec!["in-rust-tree".to_owned()],
632632
source_type: SourceType::InTree,
633633
allow_features: RustAnalyzer::ALLOW_FEATURES,
634634
})
@@ -673,9 +673,9 @@ impl Step for RustAnalyzerProcMacroSrv {
673673
compiler: self.compiler,
674674
target: self.target,
675675
tool: "rust-analyzer-proc-macro-srv",
676-
mode: Mode::ToolStd,
676+
mode: Mode::ToolRustc,
677677
path: "src/tools/rust-analyzer/crates/proc-macro-srv-cli",
678-
extra_features: vec!["sysroot-abi".to_owned()],
678+
extra_features: vec!["sysroot-abi".to_owned(), "in-rust-tree".to_owned()],
679679
source_type: SourceType::InTree,
680680
allow_features: RustAnalyzer::ALLOW_FEATURES,
681681
});

src/tools/rust-analyzer/crates/mbe/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ span.workspace = true
2727
[dev-dependencies]
2828
test-utils.workspace = true
2929

30+
[features]
31+
in-rust-tree = ["parser/in-rust-tree", "syntax/in-rust-tree"]
32+
3033
[lints]
31-
workspace = true
34+
workspace = true

src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ proc-macro-api.workspace = true
1414

1515
[features]
1616
sysroot-abi = ["proc-macro-srv/sysroot-abi"]
17+
in-rust-tree = ["proc-macro-srv/in-rust-tree"]
18+
1719

1820
[[bin]]
1921
name = "rust-analyzer-proc-macro-srv"

src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ expect-test = "1.4.0"
3737
proc-macro-test.path = "./proc-macro-test"
3838

3939
[features]
40-
sysroot-abi = ["proc-macro-test/sysroot-abi"]
40+
sysroot-abi = []
41+
in-rust-tree = ["mbe/in-rust-tree"]
4142

4243
[lints]
43-
workspace = true
44+
workspace = true

src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
//! rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)…
1212
1313
#![cfg(any(feature = "sysroot-abi", rust_analyzer))]
14-
#![feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span)]
14+
#![feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span, rustc_private)]
1515
#![warn(rust_2018_idioms, unused_lifetimes)]
1616
#![allow(unreachable_pub, internal_features)]
1717

1818
extern crate proc_macro;
19+
extern crate rustc_driver as _;
1920

2021
mod dylib;
2122
mod server;

0 commit comments

Comments
 (0)