Skip to content

Commit ff7b661

Browse files
committed
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 rust-lang#126351.
1 parent 2699de6 commit ff7b661

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

std/src/fs/tests.rs

-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use rand::RngCore;
22

3-
#[cfg(target_os = "macos")]
4-
use crate::ffi::{c_char, c_int};
53
use crate::fs::{self, File, FileTimes, OpenOptions};
64
use crate::io::prelude::*;
75
use crate::io::{BorrowedBuf, ErrorKind, SeekFrom};
@@ -16,8 +14,6 @@ use crate::os::unix::fs::symlink as junction_point;
1614
use crate::os::windows::fs::{junction_point, symlink_dir, symlink_file, OpenOptionsExt};
1715
use crate::path::Path;
1816
use crate::sync::Arc;
19-
#[cfg(target_os = "macos")]
20-
use crate::sys::weak::weak;
2117
use crate::sys_common::io::test::{tmpdir, TempDir};
2218
use crate::time::{Duration, Instant, SystemTime};
2319
use crate::{env, str, thread};
@@ -80,17 +76,6 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
8076
}
8177
}
8278

83-
#[cfg(target_os = "macos")]
84-
fn able_to_not_follow_symlinks_while_hard_linking() -> bool {
85-
weak!(fn linkat(c_int, *const c_char, c_int, *const c_char, c_int) -> c_int);
86-
linkat.get().is_some()
87-
}
88-
89-
#[cfg(not(target_os = "macos"))]
90-
fn able_to_not_follow_symlinks_while_hard_linking() -> bool {
91-
return true;
92-
}
93-
9479
#[test]
9580
fn file_test_io_smoke_test() {
9681
let message = "it's alright. have a good time";
@@ -1456,9 +1441,6 @@ fn symlink_hard_link() {
14561441
if !got_symlink_permission(&tmpdir) {
14571442
return;
14581443
};
1459-
if !able_to_not_follow_symlinks_while_hard_linking() {
1460-
return;
1461-
}
14621444

14631445
// Create "file", a file.
14641446
check!(fs::File::create(tmpdir.join("file")));

0 commit comments

Comments
 (0)