about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/std/src/fs/tests.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs
index 12afdef2669..5917bf8df02 100644
--- a/library/std/src/fs/tests.rs
+++ b/library/std/src/fs/tests.rs
@@ -936,8 +936,10 @@ fn read_link() {
         }
         // Check that readlink works with non-drive paths on Windows.
         let link = tmpdir.join("link_unc");
-        check!(symlink_dir(r"\\localhost\c$\", &link));
-        assert_eq!(check!(fs::read_link(&link)), Path::new(r"\\localhost\c$\"));
+        if got_symlink_permission(&tmpdir) {
+            check!(symlink_dir(r"\\localhost\c$\", &link));
+            assert_eq!(check!(fs::read_link(&link)), Path::new(r"\\localhost\c$\"));
+        };
     }
     let link = tmpdir.join("link");
     if !got_symlink_permission(&tmpdir) {