mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
Arc proc-macro expander paths
This commit is contained in:
parent
c236190b60
commit
956c8521a9
2 changed files with 5 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
//! Protocol functions for json.
|
||||||
use std::io::{self, BufRead, Write};
|
use std::io::{self, BufRead, Write};
|
||||||
|
|
||||||
pub fn read_json<'a>(
|
pub fn read_json<'a>(
|
||||||
|
|
|
@ -65,7 +65,7 @@ impl MacroDylib {
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct ProcMacro {
|
pub struct ProcMacro {
|
||||||
process: Arc<ProcMacroProcessSrv>,
|
process: Arc<ProcMacroProcessSrv>,
|
||||||
dylib_path: AbsPathBuf,
|
dylib_path: Arc<AbsPathBuf>,
|
||||||
name: SmolStr,
|
name: SmolStr,
|
||||||
kind: ProcMacroKind,
|
kind: ProcMacroKind,
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ impl PartialEq for ProcMacro {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
self.name == other.name
|
self.name == other.name
|
||||||
&& self.kind == other.kind
|
&& self.kind == other.kind
|
||||||
&& self.dylib_path == other.dylib_path
|
&& Arc::ptr_eq(&self.dylib_path, &other.dylib_path)
|
||||||
&& Arc::ptr_eq(&self.process, &other.process)
|
&& Arc::ptr_eq(&self.process, &other.process)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,7 @@ impl ProcMacroServer {
|
||||||
let _p = tracing::info_span!("ProcMacroServer::load_dylib").entered();
|
let _p = tracing::info_span!("ProcMacroServer::load_dylib").entered();
|
||||||
let macros = self.process.find_proc_macros(&dylib.path)?;
|
let macros = self.process.find_proc_macros(&dylib.path)?;
|
||||||
|
|
||||||
|
let dylib_path = Arc::new(dylib.path);
|
||||||
match macros {
|
match macros {
|
||||||
Ok(macros) => Ok(macros
|
Ok(macros) => Ok(macros
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -123,7 +124,7 @@ impl ProcMacroServer {
|
||||||
process: self.process.clone(),
|
process: self.process.clone(),
|
||||||
name: name.into(),
|
name: name.into(),
|
||||||
kind,
|
kind,
|
||||||
dylib_path: dylib.path.clone(),
|
dylib_path: dylib_path.clone(),
|
||||||
})
|
})
|
||||||
.collect()),
|
.collect()),
|
||||||
Err(message) => Err(ServerError { message, io: None }),
|
Err(message) => Err(ServerError { message, io: None }),
|
||||||
|
|
Loading…
Reference in a new issue