diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-03 23:13:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-03 23:13:18 -0700 |
| commit | f2ec71fe74ca9db59dbcc43983d689ca31139779 (patch) | |
| tree | 8b3dc512a526daaeb3ea3c8d09abe2f8d865d286 /library | |
| parent | e500f1c1e9de96edc3ac1ce1bccc0f241fa41c0a (diff) | |
| parent | 22112e439092e26536a9c9aaa35e892ce36afbea (diff) | |
| download | rust-f2ec71fe74ca9db59dbcc43983d689ca31139779.tar.gz rust-f2ec71fe74ca9db59dbcc43983d689ca31139779.zip | |
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.
Diffstat (limited to 'library')
| -rw-r--r-- | library/std/src/sys/unix/process/process_unix.rs | 3 |
1 files changed, 1 insertions, 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 } } |
