diff options
| author | LinkTed <LinkTed@users.noreply.github.com> | 2020-10-04 19:28:38 +0200 |
|---|---|---|
| committer | LinkTed <LinkTed@users.noreply.github.com> | 2020-10-10 15:19:13 +0200 |
| commit | fc65f6a0ce74a2d325a04f1b87edfa5ecbfa6ccd (patch) | |
| tree | 144fccef8d563587a8f6303af212c08e7254c8e1 /library/std/src | |
| parent | a81764731cade72b551b213941ac2cd16a980788 (diff) | |
| download | rust-fc65f6a0ce74a2d325a04f1b87edfa5ecbfa6ccd.tar.gz rust-fc65f6a0ce74a2d325a04f1b87edfa5ecbfa6ccd.zip | |
Fix import errors for `#[cfg(doc)]` target
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sys/unix/ext/net/ancillary.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs index e36ad8b956a..e1d0fe125cc 100644 --- a/library/std/src/sys/unix/ext/net/ancillary.rs +++ b/library/std/src/sys/unix/ext/net/ancillary.rs @@ -9,12 +9,11 @@ use crate::ptr::read_unaligned; use crate::slice::from_raw_parts; use crate::sys::net::Socket; -#[cfg(any(target_os = "android", target_os = "linux",))] -use libc::{gid_t, pid_t, uid_t}; // FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here? #[cfg(not(unix))] #[allow(non_camel_case_types)] mod libc { + pub use libc::c_int; pub struct ucred; pub struct cmsghdr; pub type pid_t = i32; @@ -22,6 +21,9 @@ mod libc { pub type uid_t = u32; } +#[cfg(any(doc, target_os = "android", target_os = "linux",))] +use libc::{gid_t, pid_t, uid_t}; + pub(super) fn recv_vectored_with_ancillary_from( socket: &Socket, bufs: &mut [IoSliceMut<'_>], |
