]> git.lizzy.rs Git - rust.git/commitdiff
make fs.rs at least build under Windows
authorRalf Jung <post@ralfj.de>
Mon, 23 Mar 2020 22:48:12 +0000 (23:48 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 24 Mar 2020 08:11:48 +0000 (09:11 +0100)
tests/run-pass/fs.rs

index 0f3512b366050221d7f578d95124e80ad353498a..b6d460f7a981ca0b7b58e261d04ab7e9efb2de0f 100644 (file)
@@ -142,7 +142,10 @@ fn test_symlink() {
     let symlink_path = prepare("miri_test_fs_symlink.txt");
 
     // Creating a symbolic link should succeed.
+    #[cfg(unix)]
     std::os::unix::fs::symlink(&path, &symlink_path).unwrap();
+    #[cfg(windows)]
+    std::os::windows::fs::symlink_file(&path, &symlink_path).unwrap();
     // Test that the symbolic link has the same contents as the file.
     let mut symlink_file = File::open(&symlink_path).unwrap();
     let mut contents = Vec::new();