mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 22:46:50 +00:00
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.
This commit is contained in:
commit
f2ec71fe74
@ -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 }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user