From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../crates/proc-macro-srv-cli/Cargo.toml | 17 +++++++++++++++++ .../crates/proc-macro-srv-cli/src/main.rs | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml create mode 100644 src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs (limited to 'src/tools/rust-analyzer/crates/proc-macro-srv-cli') 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 new file mode 100644 index 000000000..9d0da5dee --- /dev/null +++ b/src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "proc-macro-srv-cli" +version = "0.0.0" +description = "TBD" +license = "MIT OR Apache-2.0" +edition = "2021" +rust-version = "1.57" + +[dependencies] +proc-macro-srv = { version = "0.0.0", path = "../proc-macro-srv" } + +[features] +sysroot-abi = ["proc-macro-srv/sysroot-abi"] + +[[bin]] +name = "rust-analyzer-proc-macro-srv" +path = "src/main.rs" diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs b/src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs new file mode 100644 index 000000000..ac9fa9f5a --- /dev/null +++ b/src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs @@ -0,0 +1,19 @@ +//! A standalone binary for `proc-macro-srv`. + +use proc_macro_srv::cli; + +fn main() -> std::io::Result<()> { + let v = std::env::var("RUST_ANALYZER_INTERNALS_DO_NOT_USE"); + match v.as_deref() { + Ok("this is unstable") => { + // very well, if you must + } + _ => { + eprintln!("If you're rust-analyzer, you can use this tool by exporting RUST_ANALYZER_INTERNALS_DO_NOT_USE='this is unstable'."); + eprintln!("If not, you probably shouldn't use this tool. But do what you want: I'm an error message, not a cop."); + std::process::exit(122); + } + } + + cli::run() +} -- cgit v1.2.3