]> git.lizzy.rs Git - rust.git/commitdiff
Fix
authorEdwin Cheng <edwin0cheng@gmail.com>
Sat, 25 Apr 2020 04:48:59 +0000 (12:48 +0800)
committerEdwin Cheng <edwin0cheng@gmail.com>
Sun, 26 Apr 2020 09:17:37 +0000 (17:17 +0800)
crates/ra_proc_macro_srv/src/dylib.rs

index 018cc7bb80758b4cb731b926334291fafbb97020..99c83481a0437391d8a6b7d6bc9d7724e908dfb9 100644 (file)
@@ -199,6 +199,7 @@ pub fn list_macros(&self) -> Vec<(String, ProcMacroKind)> {
     }
 }
 
+#[cfg(windows)]
 fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
     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<PathBuf> {
     std::fs::copy(path, &to)?;
     Ok(to)
 }
+
+#[cfg(unix)]
+fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
+    Ok(path.to_path_buf())
+}