diff options
| author | Amos Wenger <amoswenger@gmail.com> | 2022-07-26 11:53:50 +0200 |
|---|---|---|
| committer | Amos Wenger <amoswenger@gmail.com> | 2022-07-26 11:53:50 +0200 |
| commit | 8bcd4a2b4cb2ee8299834dbf4a85906fc5b8a2a1 (patch) | |
| tree | e220a7ae8c787e33cc644537d1ee4d2bef874f75 /src/tools/rust-analyzer/crates/proc-macro-srv-cli | |
| parent | b629c85bd74dfb730a3e9308312b007c0bf027cb (diff) | |
| parent | e36a20c24f35a4cee82bbdc600289104c9237c22 (diff) | |
| download | rust-8bcd4a2b4cb2ee8299834dbf4a85906fc5b8a2a1.tar.gz rust-8bcd4a2b4cb2ee8299834dbf4a85906fc5b8a2a1.zip | |
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-and-pms-component
Diffstat (limited to 'src/tools/rust-analyzer/crates/proc-macro-srv-cli')
| -rw-r--r-- | src/tools/rust-analyzer/crates/proc-macro-srv-cli/Cargo.toml | 17 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs | 19 |
2 files changed, 36 insertions, 0 deletions
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 00000000000..9d0da5dee9c --- /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 00000000000..ac9fa9f5a4c --- /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() +} |
