Skip to content

Commit f2ec71f

Browse files
authored
Rollup merge of #88286 - LeSeulArtichaut:unnecessary-unsafe-block-std, r=dtolnay
Remove unnecessary unsafe block in `process_unix` Because it's nested under this unsafe fn! This block isn't detected as unnecessary because of a bug in the compiler: #88260.
2 parents e500f1c + 22112e4 commit f2ec71f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/std/src/sys/unix/process/process_unix.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ impl Process {
552552
use crate::os::unix::io::FromRawFd;
553553
use crate::sys_common::FromInner;
554554
// Safety: If `pidfd` is nonnegative, we assume it's valid and otherwise unowned.
555-
let pidfd = (pidfd >= 0)
556-
.then(|| PidFd::from_inner(unsafe { sys::fd::FileDesc::from_raw_fd(pidfd) }));
555+
let pidfd = (pidfd >= 0).then(|| PidFd::from_inner(sys::fd::FileDesc::from_raw_fd(pidfd)));
557556
Process { pid, status: None, pidfd }
558557
}
559558

0 commit comments

Comments
 (0)