Check for Debug impls for all types

This was not compile-tested on all platforms, but instead all `pub enum`
types had a `Debug` impl derived for them.
This commit is contained in:
Bryant Mairs 2019-01-23 07:18:32 -08:00
parent cd1e16d1af
commit fa9cb78b4a
17 changed files with 36 additions and 5 deletions

View File

@ -122,7 +122,9 @@ pub const PTHREAD_STACK_MIN: ::size_t = 1024;
pub const SOCK_DGRAM: ::c_int = 128;
pub const SOCK_STREAM: ::c_int = 130;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
extern {

View File

@ -100,9 +100,13 @@ pub type c_ulong = u64;
// FIXME: why are these uninhabited types? that seems... wrong?
// Presumably these should be `()` or an `extern type` (when that stabilizes).
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum DIR {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum locale_t {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
// PUB_STRUCT
@ -3042,7 +3046,9 @@ f! {
#[link(name = "fdio")]
extern {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
extern {

View File

@ -156,6 +156,8 @@
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
#![cfg_attr(feature = "rustc-dep-of-std", allow(warnings))]
#![cfg_attr(not(any(feature = "use_std", feature = "rustc-dep-of-std")), no_std)]
// Enable lints
#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))]
#[cfg(all(not(cross_platform_docs), feature = "use_std"))]
extern crate std as core;

View File

@ -219,7 +219,9 @@ pub const SIGIO: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
pub const SIGSYS: ::c_int = 31;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
// intentionally not public, only used for fd_set

View File

@ -34,6 +34,7 @@ pub type posix_spawn_file_actions_t = *mut ::c_void;
pub type key_t = ::c_int;
pub type shmatt_t = ::c_ushort;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
s! {

View File

@ -17,6 +17,7 @@ pub type fsfilcnt_t = u64;
pub type sem_t = *mut sem;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
s! {

View File

@ -16,6 +16,7 @@ pub type speed_t = ::c_uint;
pub type nl_item = ::c_int;
pub type id_t = i64;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
s! {

View File

@ -13,7 +13,9 @@ pub type clockid_t = ::c_int;
pub type id_t = ::uint32_t;
pub type sem_t = *mut sem;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
s! {

View File

@ -31,6 +31,7 @@ pub type nl_item = ::c_int;
pub type id_t = i32;
pub type idtype_t = ::c_uint;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
s! {

View File

@ -41,7 +41,9 @@ pub type in_port_t = u16;
pub type sighandler_t = ::size_t;
pub type cc_t = ::c_uchar;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum DIR {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum locale_t {}
s! {
@ -365,7 +367,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
extern {

View File

@ -264,7 +264,7 @@ impl std::fmt::Debug for dirent {
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_name", &self.d_name)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
@ -302,7 +302,7 @@ impl std::fmt::Debug for dirent64 {
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_name", &self.d_name)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
@ -374,7 +374,7 @@ impl std::fmt::Debug for lastlog {
f.debug_struct("lastlog")
.field("ll_time", &self.ll_time)
.field("ll_line", &self.ll_line)
.field("ll_host", &self.ll_host)
// FIXME: .field("ll_host", &self.ll_host)
.finish()
}
}
@ -425,7 +425,7 @@ impl std::fmt::Debug for utmp {
.field("ut_line", &self.ut_line)
.field("ut_id", &self.ut_id)
.field("ut_user", &self.ut_user)
.field("ut_host", &self.ut_host)
// FIXME: .field("ut_host", &self.ut_host)
.field("ut_exit", &self.ut_exit)
.field("ut_session", &self.ut_session)
.field("ut_tv", &self.ut_tv)

View File

@ -35,6 +35,7 @@ pub type c_long = i32;
pub type c_ulong = u32;
pub type nlink_t = u32;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
s! {

View File

@ -38,6 +38,7 @@ pub type Elf64_Sxword = i64;
pub type Elf32_Section = u16;
pub type Elf64_Section = u16;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
s! {

View File

@ -8,6 +8,7 @@ pub type clockid_t = ::c_int;
pub type key_t = ::c_int;
pub type id_t = ::c_uint;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
s! {

View File

@ -36,6 +36,7 @@ pub type nl_item = ::c_int;
pub type id_t = ::c_int;
pub type idtype_t = ::c_uint;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
s! {

View File

@ -24,8 +24,10 @@ pub type nfds_t = ::c_ulong;
pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
s! {

View File

@ -47,6 +47,7 @@ cfg_if! {
pub type off_t = i32;
pub type dev_t = u32;
pub type ino_t = u16;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
pub type time64_t = i64;
@ -201,7 +202,9 @@ pub const SIG_ERR: ::c_int = -1;
#[link(name = "libcmt", cfg(target_feature = "crt-static"))]
extern {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
extern {
@ -446,4 +449,4 @@ cfg_if! {
} else {
// Unknown target_env
}
}
}