From fb996cae6bf5bb5f60176a4a190311d4363b3e10 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 25 Apr 2020 12:48:59 +0800 Subject: [PATCH] Fix --- crates/ra_proc_macro_srv/src/dylib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ra_proc_macro_srv/src/dylib.rs b/crates/ra_proc_macro_srv/src/dylib.rs index 018cc7bb807..99c83481a04 100644 --- a/crates/ra_proc_macro_srv/src/dylib.rs +++ b/crates/ra_proc_macro_srv/src/dylib.rs @@ -199,6 +199,7 @@ pub fn list_macros(&self) -> Vec<(String, ProcMacroKind)> { } } +#[cfg(windows)] fn copy_to_temp_dir(path: &Path) -> io::Result { let mut to = std::env::temp_dir(); let file_name = path.file_name().ok_or_else(|| { @@ -212,3 +213,8 @@ fn copy_to_temp_dir(path: &Path) -> io::Result { std::fs::copy(path, &to)?; Ok(to) } + +#[cfg(unix)] +fn copy_to_temp_dir(path: &Path) -> io::Result { + Ok(path.to_path_buf()) +}