mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-15 21:34:19 +00:00
Gate and rename binary, use it if it's in the sysroot
This commit is contained in:
parent
dadb83282d
commit
74a2fad5e6
4 changed files with 22 additions and 1 deletions
|
|
@ -13,5 +13,5 @@ proc-macro-srv = { version = "0.0.0", path = "../proc-macro-srv" }
|
|||
sysroot-abi = ["proc-macro-srv/sysroot-abi"]
|
||||
|
||||
[[bin]]
|
||||
name = "proc-macro-srv"
|
||||
name = "rust-analyzer-proc-macro-srv"
|
||||
path = "src/main.rs"
|
||||
|
|
|
|||
|
|
@ -3,5 +3,17 @@
|
|||
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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue