Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-srv-cli/src/main.rs')
| -rw-r--r-- | crates/proc-macro-srv-cli/src/main.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/proc-macro-srv-cli/src/main.rs b/crates/proc-macro-srv-cli/src/main.rs new file mode 100644 index 0000000000..ac9fa9f5a4 --- /dev/null +++ b/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() +} |