about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-11-17 10:06:29 +0100
committerGitHub <noreply@github.com>2020-11-17 10:06:29 +0100
commita207801551e39278e9d65581d33ed22b97e19294 (patch)
tree3187d8edfd03397a6606eac014ff19dbb92b2b9c
parentc4abdcf0ac8fd9643f1c196a418e032e85c1988c (diff)
parenta5bc780b508f373ff0c03b8a73c384204bfe1b0f (diff)
downloadrust-a207801551e39278e9d65581d33ed22b97e19294.tar.gz
rust-a207801551e39278e9d65581d33ed22b97e19294.zip
Rollup merge of #79105 - petrochenkov:winlink, r=shepmaster
std: Fix test `symlink_hard_link` on Windows

The test was introduced in https://github.com/rust-lang/rust/pull/78026 and fails depending on Windows version and admin rights.
Other similar tests check for symlink creation permissions before doing anything, this PR performs the same check for `symlink_hard_link` as well.
-rw-r--r--library/std/src/fs/tests.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs
index 0642dca8e48..5c969741592 100644
--- a/library/std/src/fs/tests.rs
+++ b/library/std/src/fs/tests.rs
@@ -1341,6 +1341,9 @@ fn metadata_access_times() {
 #[test]
 fn symlink_hard_link() {
     let tmpdir = tmpdir();
+    if !got_symlink_permission(&tmpdir) {
+        return;
+    };
 
     // Create "file", a file.
     check!(fs::File::create(tmpdir.join("file")));