Skip to content

Commit d5dded9

Browse files
committed
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.
1 parent 81a4950 commit d5dded9

File tree

17 files changed

+36
-5
lines changed

17 files changed

+36
-5
lines changed

src/cloudabi/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ pub const PTHREAD_STACK_MIN: ::size_t = 1024;
122122
pub const SOCK_DGRAM: ::c_int = 128;
123123
pub const SOCK_STREAM: ::c_int = 130;
124124

125+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
125126
pub enum FILE {}
127+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
126128
pub enum fpos_t {} // TODO: fill this out with a struct
127129

128130
extern {

src/fuchsia/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ pub type c_ulong = u64;
100100

101101
// FIXME: why are these uninhabited types? that seems... wrong?
102102
// Presumably these should be `()` or an `extern type` (when that stabilizes).
103+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
103104
pub enum timezone {}
105+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
104106
pub enum DIR {}
107+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
105108
pub enum locale_t {}
109+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
106110
pub enum fpos64_t {} // TODO: fill this out with a struct
107111

108112
// PUB_STRUCT
@@ -3042,7 +3046,9 @@ f! {
30423046
#[link(name = "fdio")]
30433047
extern {}
30443048

3049+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
30453050
pub enum FILE {}
3051+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
30463052
pub enum fpos_t {} // TODO: fill this out with a struct
30473053

30483054
extern {

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@
156156
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
157157
#![cfg_attr(feature = "rustc-dep-of-std", allow(warnings))]
158158
#![cfg_attr(not(any(feature = "use_std", feature = "rustc-dep-of-std")), no_std)]
159+
// Enable lints
160+
#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))]
159161

160162
#[cfg(all(not(cross_platform_docs), feature = "use_std"))]
161163
extern crate std as core;

src/redox/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ pub const SIGIO: ::c_int = 29;
219219
pub const SIGPWR: ::c_int = 30;
220220
pub const SIGSYS: ::c_int = 31;
221221

222+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
222223
pub enum FILE {}
224+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
223225
pub enum fpos_t {} // TODO: fill this out with a struct
224226

225227
// intentionally not public, only used for fd_set

src/unix/bsd/apple/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub type posix_spawn_file_actions_t = *mut ::c_void;
3434
pub type key_t = ::c_int;
3535
pub type shmatt_t = ::c_ushort;
3636

37+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
3738
pub enum timezone {}
3839

3940
s! {

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub type fsfilcnt_t = u64;
1717

1818
pub type sem_t = *mut sem;
1919

20+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
2021
pub enum sem {}
2122

2223
s! {

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub type speed_t = ::c_uint;
1616
pub type nl_item = ::c_int;
1717
pub type id_t = i64;
1818

19+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
1920
pub enum timezone {}
2021

2122
s! {

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ pub type clockid_t = ::c_int;
1313
pub type id_t = ::uint32_t;
1414
pub type sem_t = *mut sem;
1515

16+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
1617
pub enum timezone {}
18+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
1719
pub enum sem {}
1820

1921
s! {

src/unix/haiku/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub type nl_item = ::c_int;
3131
pub type id_t = i32;
3232
pub type idtype_t = ::c_uint;
3333

34+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
3435
pub enum timezone {}
3536

3637
s! {

src/unix/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ pub type in_port_t = u16;
4141
pub type sighandler_t = ::size_t;
4242
pub type cc_t = ::c_uchar;
4343

44+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
4445
pub enum DIR {}
46+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
4547
pub enum locale_t {}
4648

4749
s! {
@@ -365,7 +367,9 @@ cfg_if! {
365367
}
366368
}
367369

370+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
368371
pub enum FILE {}
372+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
369373
pub enum fpos_t {} // TODO: fill this out with a struct
370374

371375
extern {

0 commit comments

Comments
 (0)