File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,7 @@ expect-test = "1.2.0-pre.1"
3030
3131# used as proc macro test targets
3232proc_macro_test = { path = " ../proc_macro_test" }
33+
34+ [features ]
35+ default = [" copy-dll-on-windows" ]
36+ copy-dll-on-windows = [] # Please keep the feature (or another way to disable DLL copying) for intellij-rust
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ impl Expander {
162162}
163163
164164/// Copy the dylib to temp directory to prevent locking in Windows
165- #[ cfg( windows) ]
165+ #[ cfg( all ( windows, feature = "copy-dll-on-windows" ) ) ]
166166fn ensure_file_with_lock_free_access ( path : & Path ) -> io:: Result < PathBuf > {
167167 use std:: collections:: hash_map:: RandomState ;
168168 use std:: ffi:: OsString ;
@@ -189,7 +189,7 @@ fn ensure_file_with_lock_free_access(path: &Path) -> io::Result<PathBuf> {
189189 Ok ( to)
190190}
191191
192- #[ cfg( unix) ]
192+ #[ cfg( any ( unix, not ( feature = "copy-dll-on-windows" ) ) ) ]
193193fn ensure_file_with_lock_free_access ( path : & Path ) -> io:: Result < PathBuf > {
194194 Ok ( path. to_path_buf ( ) )
195195}
You can’t perform that action at this time.
0 commit comments