Auto merge of #18205 - noahmbright:object_safety, r=HKalbasi
Rename object_safety
First PR here (yay!), so I read some of the getting started docs. There are a couple references to `handlers.rs`, which as far as I can tell has been refactored into `handlers/*.rs`. I made some tweaks to that in one commit. There is one fixme about a function called `to_lsp_runnable`, which I can't find anywhere at all. I can update that if I get some more info there.
Otherwise I changed references to object safety, is object safe, etc., trying to match case/style as I went. There was one case I found where there's a trait from somewhere else called `is_object_safe`, which I found defined in my cargo registry. I didn't touch that for now, just marked it with a fixme
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs
index e899e0e..2851101 100644
--- a/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -81,7 +81,13 @@
with_proc_macro_server: if self.disable_proc_macros {
ProcMacroServerChoice::None
} else {
- ProcMacroServerChoice::Sysroot
+ match self.proc_macro_srv {
+ Some(ref path) => {
+ let path = vfs::AbsPathBuf::assert_utf8(path.to_owned());
+ ProcMacroServerChoice::Explicit(path)
+ }
+ None => ProcMacroServerChoice::Sysroot,
+ }
},
prefill_caches: false,
};
diff --git a/crates/rust-analyzer/src/cli/flags.rs b/crates/rust-analyzer/src/cli/flags.rs
index 73e7165..60d621b 100644
--- a/crates/rust-analyzer/src/cli/flags.rs
+++ b/crates/rust-analyzer/src/cli/flags.rs
@@ -76,6 +76,8 @@
optional --disable-build-scripts
/// Don't use expand proc macros.
optional --disable-proc-macros
+ /// Run the proc-macro-srv binary at the specified path.
+ optional --proc-macro-srv path: PathBuf
/// Skip body lowering.
optional --skip-lowering
/// Skip type inference.
@@ -120,7 +122,7 @@
optional --disable-build-scripts
/// Don't use expand proc macros.
optional --disable-proc-macros
- /// Run a custom proc-macro-srv binary.
+ /// Run the proc-macro-srv binary at the specified path.
optional --proc-macro-srv path: PathBuf
}
@@ -133,7 +135,7 @@
optional --disable-build-scripts
/// Don't use expand proc macros.
optional --disable-proc-macros
- /// Run a custom proc-macro-srv binary.
+ /// Run the proc-macro-srv binary at the specified path.
optional --proc-macro-srv path: PathBuf
}
@@ -233,6 +235,7 @@
pub no_sysroot: bool,
pub disable_build_scripts: bool,
pub disable_proc_macros: bool,
+ pub proc_macro_srv: Option<PathBuf>,
pub skip_lowering: bool,
pub skip_inference: bool,
pub skip_mir_stats: bool,