diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index e4643880690..fb8d06c6682 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -560,7 +560,7 @@ pub fn is_symlink(&self) -> bool { } pub fn is(&self, mode: mode_t) -> bool { - self.mode & libc::S_IFMT == mode + self.masked() == mode } fn masked(&self) -> mode_t {