summary refs log tree commit diff
path: root/src/libstd/os
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-11-25 13:21:49 -0500
committerCorey Farwell <coreyf@rwell.org>2016-12-18 14:55:14 -0800
commit86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8 (patch)
treeb4b2329077e4e537719a8f0556525c66d4d8f73c /src/libstd/os
parent1f965cc8e9dc8f8b26eac99cffdef6501cf0c617 (diff)
downloadrust-86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8.tar.gz
rust-86fc63e62ddc0a271210b8cc7cc2a6de6874b8f8.zip
Implement `fmt::Debug` for all structures in libstd.
Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
Diffstat (limited to 'src/libstd/os')
-rw-r--r--src/libstd/os/linux/raw.rs1
-rw-r--r--src/libstd/os/macos/raw.rs2
-rw-r--r--src/libstd/os/raw.rs9
3 files changed, 11 insertions, 1 deletions
diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs
index e6a95bc831f..7c9274d0601 100644
--- a/src/libstd/os/linux/raw.rs
+++ b/src/libstd/os/linux/raw.rs
@@ -17,6 +17,7 @@
                               crates.io should be used instead for the correct \
                               definitions")]
 #![allow(deprecated)]
+#![allow(missing_debug_implementations)]
 
 use os::raw::c_ulong;
 
diff --git a/src/libstd/os/macos/raw.rs b/src/libstd/os/macos/raw.rs
index 8f9b29462c4..0b96295f9e6 100644
--- a/src/libstd/os/macos/raw.rs
+++ b/src/libstd/os/macos/raw.rs
@@ -33,7 +33,7 @@ use os::raw::c_long;
 pub type pthread_t = usize;
 
 #[repr(C)]
-#[derive(Clone)]
+#[derive(Clone, Debug)]
 #[stable(feature = "raw_ext", since = "1.1.0")]
 pub struct stat {
     #[stable(feature = "raw_ext", since = "1.1.0")]
diff --git a/src/libstd/os/raw.rs b/src/libstd/os/raw.rs
index 2a918d8aeb7..cc154f7ab41 100644
--- a/src/libstd/os/raw.rs
+++ b/src/libstd/os/raw.rs
@@ -12,6 +12,8 @@
 
 #![stable(feature = "raw_os", since = "1.1.0")]
 
+use fmt;
+
 #[cfg(any(target_os = "android",
           target_os = "emscripten",
           all(target_os = "linux", any(target_arch = "aarch64",
@@ -71,6 +73,13 @@ pub enum c_void {
     #[doc(hidden)] __variant2,
 }
 
+#[stable(feature = "std_debug", since = "1.15.0")]
+impl fmt::Debug for c_void {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.pad("c_void")
+    }
+}
+
 #[cfg(test)]
 #[allow(unused_imports)]
 mod tests {