Skip to content

Commit

Permalink
Set the in-rust-tree feature for all rust-analyzer{-proc-macro-srv}…
Browse files Browse the repository at this point in the history
… steps
  • Loading branch information
Veykril committed Dec 12, 2023
1 parent 5f5d248 commit 66bb2d7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,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()],
is_optional_tool: false,
source_type: SourceType::InTree,
allow_features: RustAnalyzer::ALLOW_FEATURES,
Expand Down Expand Up @@ -692,7 +692,7 @@ impl Step for RustAnalyzerProcMacroSrv {
tool: "rust-analyzer-proc-macro-srv",
mode: Mode::ToolStd,
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()],
is_optional_tool: false,
source_type: SourceType::InTree,
allow_features: RustAnalyzer::ALLOW_FEATURES,
Expand Down
3 changes: 3 additions & 0 deletions src/tools/rust-analyzer/crates/mbe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ stdx.workspace = true

[dev-dependencies]
test-utils.workspace = true

[features]
in-rust-tree = ["parser/in-rust-tree", "syntax/in-rust-tree"]
2 changes: 2 additions & 0 deletions src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/crates/proc-macro-srv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ proc-macro-test.workspace = true

[features]
sysroot-abi = []
in-rust-tree = ["mbe/in-rust-tree"]
3 changes: 2 additions & 1 deletion src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
//! rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)…
#![cfg(feature = "sysroot-abi")]
#![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, semicolon_in_expressions_from_macros)]
#![allow(unreachable_pub, internal_features)]

extern crate proc_macro;
extern crate rustc_driver as _;

mod dylib;
mod server;
Expand Down

0 comments on commit 66bb2d7

Please sign in to comment.