diff options
author | Bryant Mairs <bryantmairs@google.com> | 2018-01-14 10:44:16 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2018-01-28 17:39:12 -0800 |
commit | 4ea63e1544f17afc1a54f805625091be8dcd8227 (patch) | |
tree | 058f44908eecbef378851114338a7b28c65a5c59 | |
parent | 58bd6bf34c576e9743638edf448c9491f9428ef8 (diff) | |
download | nix-4ea63e1544f17afc1a54f805625091be8dcd8227.zip |
Require Debug impls for all types
-rw-r--r-- | src/fcntl.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/mqueue.rs | 1 | ||||
-rw-r--r-- | src/poll.rs | 1 | ||||
-rw-r--r-- | src/pty.rs | 1 | ||||
-rw-r--r-- | src/sched.rs | 1 | ||||
-rw-r--r-- | src/sys/epoll.rs | 1 | ||||
-rw-r--r-- | src/sys/event.rs | 1 | ||||
-rw-r--r-- | src/sys/quota.rs | 1 | ||||
-rw-r--r-- | src/sys/select.rs | 1 | ||||
-rw-r--r-- | src/sys/signal.rs | 3 | ||||
-rw-r--r-- | src/sys/socket/mod.rs | 5 | ||||
-rw-r--r-- | src/sys/statvfs.rs | 1 | ||||
-rw-r--r-- | src/sys/termios.rs | 1 | ||||
-rw-r--r-- | src/sys/uio.rs | 2 | ||||
-rw-r--r-- | src/sys/utsname.rs | 1 | ||||
-rw-r--r-- | src/ucontext.rs | 1 | ||||
-rw-r--r-- | src/unistd.rs | 4 |
18 files changed, 27 insertions, 2 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs index e5263627..58de3b31 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -205,6 +205,7 @@ libc_bitflags!( } ); +#[allow(missing_debug_implementations)] pub enum FcntlArg<'a> { F_DUPFD(RawFd), F_DUPFD_CLOEXEC(RawFd), @@ -268,6 +269,7 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> { } #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub enum FlockArg { LockShared, LockExclusive, @@ -14,6 +14,7 @@ #![deny(unstable_features)] #![deny(unused_import_braces)] #![deny(missing_copy_implementations)] +#![deny(missing_debug_implementations)] extern crate bytes; #[macro_use] diff --git a/src/mqueue.rs b/src/mqueue.rs index b9db3bab..0c6990f6 100644 --- a/src/mqueue.rs +++ b/src/mqueue.rs @@ -30,6 +30,7 @@ libc_bitflags!{ #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct MqAttr { mq_attr: libc::mq_attr, } diff --git a/src/poll.rs b/src/poll.rs index 78229a5b..4e87d43d 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -18,6 +18,7 @@ use errno::Errno; /// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct PollFd { pollfd: libc::pollfd, } @@ -18,6 +18,7 @@ use errno::Errno; /// This is returned by `openpty`. Note that this type does *not* implement `Drop`, so the user /// must manually close the file descriptors. #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct OpenptyResult { pub master: RawFd, pub slave: RawFd, diff --git a/src/sched.rs b/src/sched.rs index 17c32c44..f8f3a68a 100644 --- a/src/sched.rs +++ b/src/sched.rs @@ -40,6 +40,7 @@ pub type CloneCb<'a> = Box<FnMut() -> isize + 'a>; #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct CpuSet { cpu_set: libc::cpu_set_t, } diff --git a/src/sys/epoll.rs b/src/sys/epoll.rs index 296e9771..3ed1dd72 100644 --- a/src/sys/epoll.rs +++ b/src/sys/epoll.rs @@ -42,6 +42,7 @@ libc_bitflags!{ } } +#[allow(missing_debug_implementations)] #[derive(Clone, Copy)] #[repr(C)] pub struct EpollEvent { diff --git a/src/sys/event.rs b/src/sys/event.rs index 16b4d7dc..3a6c528d 100644 --- a/src/sys/event.rs +++ b/src/sys/event.rs @@ -14,6 +14,7 @@ use std::mem; // Redefine kevent in terms of programmer-friendly enums and bitfields. #[derive(Clone, Copy)] #[repr(C)] +#[allow(missing_debug_implementations)] pub struct KEvent { kevent: libc::kevent, } diff --git a/src/sys/quota.rs b/src/sys/quota.rs index a85d9e30..6d8e6267 100644 --- a/src/sys/quota.rs +++ b/src/sys/quota.rs @@ -100,6 +100,7 @@ libc_bitflags!( // FIXME: Change to repr(transparent) #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct Dqblk(libc::dqblk); impl Default for Dqblk { diff --git a/src/sys/select.rs b/src/sys/select.rs index aece239c..33d3e638 100644 --- a/src/sys/select.rs +++ b/src/sys/select.rs @@ -11,6 +11,7 @@ pub use libc::FD_SETSIZE; // FIXME: Change to repr(transparent) once it's stable #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct FdSet(libc::fd_set); impl FdSet { diff --git a/src/sys/signal.rs b/src/sys/signal.rs index fbd3e2d1..10798ba1 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -164,6 +164,7 @@ const SIGNALS: [Signal; 31] = [ pub const NSIG: libc::c_int = 32; #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct SignalIterator { next: usize, } @@ -256,6 +257,7 @@ libc_enum! { } #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct SigSet { sigset: libc::sigset_t } @@ -361,6 +363,7 @@ pub enum SigHandler { } #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct SigAction { sigaction: libc::sigaction } diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 5c4f19b2..beef3db8 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -320,6 +320,7 @@ cfg_if! { /// let cmsg: CmsgSpace<([RawFd; 3], CmsgSpace<[RawFd; 2]>)> = CmsgSpace::new(); /// ``` #[repr(C)] +#[allow(missing_debug_implementations)] pub struct CmsgSpace<T> { _hdr: cmsghdr, _pad: [align_of_cmsg_data; 0], @@ -335,6 +336,7 @@ impl<T> CmsgSpace<T> { } } +#[allow(missing_debug_implementations)] pub struct RecvMsg<'a> { // The number of bytes received. pub bytes: usize, @@ -354,6 +356,7 @@ impl<'a> RecvMsg<'a> { } } +#[allow(missing_debug_implementations)] pub struct CmsgIterator<'a> { buf: &'a [u8], next: usize, @@ -420,6 +423,7 @@ impl<'a> Iterator for CmsgIterator<'a> { /// A type-safe wrapper around a single control message. More types may /// be added to this enum; do not exhaustively pattern-match it. /// [Further reading](http://man7.org/linux/man-pages/man3/cmsg.3.html) +#[allow(missing_debug_implementations)] pub enum ControlMessage<'a> { /// A message of type `SCM_RIGHTS`, containing an array of file /// descriptors passed between processes. @@ -501,6 +505,7 @@ pub enum ControlMessage<'a> { // An opaque structure used to prevent cmsghdr from being a public type #[doc(hidden)] +#[allow(missing_debug_implementations)] pub struct UnknownCmsg<'a>(&'a cmsghdr, &'a [u8]); // Round `len` up to meet the platform's required alignment for diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs index dc7327d9..41ca44f2 100644 --- a/src/sys/statvfs.rs +++ b/src/sys/statvfs.rs @@ -58,6 +58,7 @@ libc_bitflags!( // FIXME: Replace with repr(transparent) #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct Statvfs(libc::statvfs); impl Statvfs { diff --git a/src/sys/termios.rs b/src/sys/termios.rs index ec5e302b..5b4cecdc 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -177,6 +177,7 @@ use ::unistd::Pid; /// standard fields. The only safe way to obtain an instance of this struct is to extract it from /// an open port using `tcgetattr()`. #[derive(Clone)] +#[allow(missing_debug_implementations)] pub struct Termios { inner: RefCell<libc::termios>, /// Input mode flags (see `termios.c_iflag` documentation) diff --git a/src/sys/uio.rs b/src/sys/uio.rs index 00ba1050..5713f63c 100644 --- a/src/sys/uio.rs +++ b/src/sys/uio.rs @@ -68,6 +68,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{ #[cfg(target_os = "linux")] #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct RemoteIoVec { /// The starting address of this slice (`iov_base`). pub base: usize, @@ -138,6 +139,7 @@ pub fn process_vm_readv(pid: ::unistd::Pid, local_iov: &[IoVec<&mut [u8]>], remo } #[repr(C)] +#[allow(missing_debug_implementations)] pub struct IoVec<T>(libc::iovec, PhantomData<T>); impl<T> IoVec<T> { diff --git a/src/sys/utsname.rs b/src/sys/utsname.rs index afec3e20..e33d0739 100644 --- a/src/sys/utsname.rs +++ b/src/sys/utsname.rs @@ -5,6 +5,7 @@ use std::str::from_utf8_unchecked; #[repr(C)] #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct UtsName(libc::utsname); impl UtsName { diff --git a/src/ucontext.rs b/src/ucontext.rs index da5a5b13..c94464d5 100644 --- a/src/ucontext.rs +++ b/src/ucontext.rs @@ -7,6 +7,7 @@ use std::mem; use sys::signal::SigSet; #[derive(Clone, Copy)] +#[allow(missing_debug_implementations)] pub struct UContext { context: libc::ucontext_t, } diff --git a/src/unistd.rs b/src/unistd.rs index 2c2d7c66..809111ff 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -143,7 +143,7 @@ impl fmt::Display for Pid { /// When `fork` is called, the process continues execution in the parent process /// and in the new child. This return type can be examined to determine whether /// you are now executing in the parent process or in the child. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub enum ForkResult { Parent { child: Pid }, Child, @@ -822,7 +822,7 @@ pub fn write(fd: RawFd, buf: &[u8]) -> Result<usize> { /// [`lseek`]: ./fn.lseek.html /// [`lseek64`]: ./fn.lseek64.html #[repr(i32)] -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub enum Whence { /// Specify an offset relative to the start of the file. SeekSet = libc::SEEK_SET, |