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
1 changed files with 1 additions and 2 deletions
|
@ -552,8 +552,7 @@ impl Process {
|
||||||
use crate::os::unix::io::FromRawFd;
|
use crate::os::unix::io::FromRawFd;
|
||||||
use crate::sys_common::FromInner;
|
use crate::sys_common::FromInner;
|
||||||
// Safety: If `pidfd` is nonnegative, we assume it's valid and otherwise unowned.
|
// Safety: If `pidfd` is nonnegative, we assume it's valid and otherwise unowned.
|
||||||
let pidfd = (pidfd >= 0)
|
let pidfd = (pidfd >= 0).then(|| PidFd::from_inner(sys::fd::FileDesc::from_raw_fd(pidfd)));
|
||||||
.then(|| PidFd::from_inner(unsafe { sys::fd::FileDesc::from_raw_fd(pidfd) }));
|
|
||||||
Process { pid, status: None, pidfd }
|
Process { pid, status: None, pidfd }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue