Auto merge of #118861 - Veykril:r-a-in-tree, r=onur-ozkan
Set the `in-rust-tree` feature for all rust-analyzer{-proc-macro-srv} steps Some context: This came up in https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/libraryfying.20match.20checking.3F where `test` and `check` behaved differently for rust-analyzer r? `@onur-ozkan`
This commit is contained in:
commit
a59a98024e
9 changed files with 21 additions and 11 deletions
|
@ -386,7 +386,7 @@ impl Step for RustAnalyzer {
|
||||||
cargo_subcommand(builder.kind),
|
cargo_subcommand(builder.kind),
|
||||||
"src/tools/rust-analyzer",
|
"src/tools/rust-analyzer",
|
||||||
SourceType::InTree,
|
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);
|
cargo.allow_features(crate::core::build_steps::tool::RustAnalyzer::ALLOW_FEATURES);
|
||||||
|
|
|
@ -385,7 +385,7 @@ impl Step for RustAnalyzer {
|
||||||
"test",
|
"test",
|
||||||
crate_path,
|
crate_path,
|
||||||
SourceType::InTree,
|
SourceType::InTree,
|
||||||
&["sysroot-abi".to_owned()],
|
&["in-rust-tree".to_owned()],
|
||||||
);
|
);
|
||||||
cargo.allow_features(tool::RustAnalyzer::ALLOW_FEATURES);
|
cargo.allow_features(tool::RustAnalyzer::ALLOW_FEATURES);
|
||||||
|
|
||||||
|
|
|
@ -628,7 +628,7 @@ impl Step for RustAnalyzer {
|
||||||
tool: "rust-analyzer",
|
tool: "rust-analyzer",
|
||||||
mode: Mode::ToolRustc,
|
mode: Mode::ToolRustc,
|
||||||
path: "src/tools/rust-analyzer",
|
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,
|
source_type: SourceType::InTree,
|
||||||
allow_features: RustAnalyzer::ALLOW_FEATURES,
|
allow_features: RustAnalyzer::ALLOW_FEATURES,
|
||||||
})
|
})
|
||||||
|
@ -673,9 +673,9 @@ impl Step for RustAnalyzerProcMacroSrv {
|
||||||
compiler: self.compiler,
|
compiler: self.compiler,
|
||||||
target: self.target,
|
target: self.target,
|
||||||
tool: "rust-analyzer-proc-macro-srv",
|
tool: "rust-analyzer-proc-macro-srv",
|
||||||
mode: Mode::ToolStd,
|
mode: Mode::ToolRustc,
|
||||||
path: "src/tools/rust-analyzer/crates/proc-macro-srv-cli",
|
path: "src/tools/rust-analyzer/crates/proc-macro-srv-cli",
|
||||||
extra_features: vec!["sysroot-abi".to_owned()],
|
extra_features: vec!["in-rust-tree".to_owned()],
|
||||||
source_type: SourceType::InTree,
|
source_type: SourceType::InTree,
|
||||||
allow_features: RustAnalyzer::ALLOW_FEATURES,
|
allow_features: RustAnalyzer::ALLOW_FEATURES,
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,5 +27,8 @@ span.workspace = true
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
test-utils.workspace = true
|
test-utils.workspace = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
in-rust-tree = ["parser/in-rust-tree", "syntax/in-rust-tree"]
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -14,10 +14,12 @@ proc-macro-api.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
sysroot-abi = ["proc-macro-srv/sysroot-abi"]
|
sysroot-abi = ["proc-macro-srv/sysroot-abi"]
|
||||||
|
in-rust-tree = ["proc-macro-srv/in-rust-tree", "sysroot-abi"]
|
||||||
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rust-analyzer-proc-macro-srv"
|
name = "rust-analyzer-proc-macro-srv"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
//! A standalone binary for `proc-macro-srv`.
|
//! A standalone binary for `proc-macro-srv`.
|
||||||
//! Driver for proc macro server
|
//! Driver for proc macro server
|
||||||
|
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
|
||||||
|
#[cfg(feature = "in-rust-tree")]
|
||||||
|
extern crate rustc_driver as _;
|
||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
fn main() -> std::io::Result<()> {
|
fn main() -> std::io::Result<()> {
|
||||||
|
|
|
@ -38,6 +38,7 @@ proc-macro-test.path = "./proc-macro-test"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
sysroot-abi = ["proc-macro-test/sysroot-abi"]
|
sysroot-abi = ["proc-macro-test/sysroot-abi"]
|
||||||
|
in-rust-tree = ["mbe/in-rust-tree", "sysroot-abi"]
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
//! rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)…
|
//! rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)…
|
||||||
|
|
||||||
#![cfg(any(feature = "sysroot-abi", rust_analyzer))]
|
#![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)]
|
#![warn(rust_2018_idioms, unused_lifetimes)]
|
||||||
#![allow(unreachable_pub, internal_features)]
|
#![allow(unreachable_pub, internal_features)]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
extern crate rustc_driver as _;
|
||||||
|
|
||||||
mod dylib;
|
mod dylib;
|
||||||
mod server;
|
mod server;
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
#![warn(rust_2018_idioms, unused_lifetimes)]
|
#![warn(rust_2018_idioms, unused_lifetimes)]
|
||||||
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
|
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
|
||||||
#[cfg(feature = "in-rust-tree")]
|
#[cfg(feature = "in-rust-tree")]
|
||||||
#[allow(unused_extern_crates)]
|
extern crate rustc_driver as _;
|
||||||
extern crate rustc_driver;
|
|
||||||
|
|
||||||
mod logger;
|
mod logger;
|
||||||
mod rustc_wrapper;
|
mod rustc_wrapper;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue