about summary refs log tree commit diff
path: root/library/std/src/fs
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2024-09-07 13:24:16 +0200
committerMads Marquart <mads@marquart.dk>2024-09-07 13:24:16 +0200
commita6c6eda61d68e7833ab541ea1479942a58f7ff3e (patch)
treedf08ee26bfb5be84bcbfd608f177b1f4eb23a885 /library/std/src/fs
parent9afe7136958edaa403f0b0eb00f0353c125b7352 (diff)
downloadrust-a6c6eda61d68e7833ab541ea1479942a58f7ff3e.tar.gz
rust-a6c6eda61d68e7833ab541ea1479942a58f7ff3e.zip
Remove now redundant check in symlink_hard_link test
We support macOS 10.12 and above, so it now always uses linkat, so the
check is redundant.

This was missed in #126351.
Diffstat (limited to 'library/std/src/fs')
-rw-r--r--library/std/src/fs/tests.rs18
1 files changed, 0 insertions, 18 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs
index 13028c4c3b5..fb8dd2b0ca1 100644
--- a/library/std/src/fs/tests.rs
+++ b/library/std/src/fs/tests.rs
@@ -1,7 +1,5 @@
 use rand::RngCore;
 
-#[cfg(target_os = "macos")]
-use crate::ffi::{c_char, c_int};
 use crate::fs::{self, File, FileTimes, OpenOptions};
 use crate::io::prelude::*;
 use crate::io::{BorrowedBuf, ErrorKind, SeekFrom};
@@ -16,8 +14,6 @@ use crate::os::unix::fs::symlink as junction_point;
 use crate::os::windows::fs::{junction_point, symlink_dir, symlink_file, OpenOptionsExt};
 use crate::path::Path;
 use crate::sync::Arc;
-#[cfg(target_os = "macos")]
-use crate::sys::weak::weak;
 use crate::sys_common::io::test::{tmpdir, TempDir};
 use crate::time::{Duration, Instant, SystemTime};
 use crate::{env, str, thread};
@@ -80,17 +76,6 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
     }
 }
 
-#[cfg(target_os = "macos")]
-fn able_to_not_follow_symlinks_while_hard_linking() -> bool {
-    weak!(fn linkat(c_int, *const c_char, c_int, *const c_char, c_int) -> c_int);
-    linkat.get().is_some()
-}
-
-#[cfg(not(target_os = "macos"))]
-fn able_to_not_follow_symlinks_while_hard_linking() -> bool {
-    return true;
-}
-
 #[test]
 fn file_test_io_smoke_test() {
     let message = "it's alright. have a good time";
@@ -1456,9 +1441,6 @@ fn symlink_hard_link() {
     if !got_symlink_permission(&tmpdir) {
         return;
     };
-    if !able_to_not_follow_symlinks_while_hard_linking() {
-        return;
-    }
 
     // Create "file", a file.
     check!(fs::File::create(tmpdir.join("file")));