From 22112e439092e26536a9c9aaa35e892ce36afbea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lanteri=20Thauvin?= <leseulartichaut@gmail.com>
Date: Tue, 24 Aug 2021 10:07:16 +0200
Subject: [PATCH] Remove unnecessary unsafe block in `process_unix`

---
 library/std/src/sys/unix/process/process_unix.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs
index 12edf04a4e2..c4215e2c78d 100644
--- a/library/std/src/sys/unix/process/process_unix.rs
+++ b/library/std/src/sys/unix/process/process_unix.rs
@@ -552,8 +552,7 @@ impl Process {
         use crate::os::unix::io::FromRawFd;
         use crate::sys_common::FromInner;
         // Safety: If `pidfd` is nonnegative, we assume it's valid and otherwise unowned.
-        let pidfd = (pidfd >= 0)
-            .then(|| PidFd::from_inner(unsafe { sys::fd::FileDesc::from_raw_fd(pidfd) }));
+        let pidfd = (pidfd >= 0).then(|| PidFd::from_inner(sys::fd::FileDesc::from_raw_fd(pidfd)));
         Process { pid, status: None, pidfd }
     }