Remove now redundant check in symlink_hard_link test · qinheping/verify-rust-std@ff7b661 (original) (raw)

1

1

`use rand::RngCore;

`

2

2

``

3

``

`-

#[cfg(target_os = "macos")]

`

4

``

`-

use crate::ffi::{c_char, c_int};

`

5

3

`use crate::fs::{self, File, FileTimes, OpenOptions};

`

6

4

`use crate::io::prelude::*;

`

7

5

`use crate::io::{BorrowedBuf, ErrorKind, SeekFrom};

`

`@@ -16,8 +14,6 @@ use crate::os::unix::fs::symlink as junction_point;

`

16

14

`use crate::os::windows::fs::{junction_point, symlink_dir, symlink_file, OpenOptionsExt};

`

17

15

`use crate::path::Path;

`

18

16

`use crate::sync::Arc;

`

19

``

`-

#[cfg(target_os = "macos")]

`

20

``

`-

use crate::sys::weak::weak;

`

21

17

`use crate::sys_common::io::test::{tmpdir, TempDir};

`

22

18

`use crate::time::{Duration, Instant, SystemTime};

`

23

19

`use crate::{env, str, thread};

`

`@@ -80,17 +76,6 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {

`

80

76

`}

`

81

77

`}

`

82

78

``

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

``

-

94

79

`#[test]

`

95

80

`fn file_test_io_smoke_test() {

`

96

81

`let message = "it's alright. have a good time";

`

`@@ -1456,9 +1441,6 @@ fn symlink_hard_link() {

`

1456

1441

`if !got_symlink_permission(&tmpdir) {

`

1457

1442

`return;

`

1458

1443

`};

`

1459

``

`-

if !able_to_not_follow_symlinks_while_hard_linking() {

`

1460

``

`-

return;

`

1461

``

`-

}

`

1462

1444

``

1463

1445

`// Create "file", a file.

`

1464

1446

`check!(fs::File::create(tmpdir.join("file")));

`