Check for Copy impls for all types
diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs
index 520ed8d..51859cb 100644
--- a/src/cloudabi/mod.rs
+++ b/src/cloudabi/mod.rs
@@ -124,8 +124,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
+impl ::dox::Copy for FILE {}
+impl ::dox::Clone for FILE {
+ fn clone(&self) -> FILE { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos_t {}
+impl ::dox::Clone for fpos_t {
+ fn clone(&self) -> fpos_t { *self }
+}
extern {
pub fn isalnum(c: c_int) -> c_int;
@@ -315,6 +323,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index 351ec7e..ba20979 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -102,12 +102,28 @@
// Presumably these should be `()` or an `extern type` (when that stabilizes).
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum DIR {}
+impl ::dox::Copy for DIR {}
+impl ::dox::Clone for DIR {
+ fn clone(&self) -> DIR { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum locale_t {}
+impl ::dox::Copy for locale_t {}
+impl ::dox::Clone for locale_t {
+ fn clone(&self) -> locale_t { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos64_t {}
+impl ::dox::Clone for fpos64_t {
+ fn clone(&self) -> fpos64_t { *self }
+}
// PUB_STRUCT
@@ -3048,8 +3064,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
+impl ::dox::Copy for FILE {}
+impl ::dox::Clone for FILE {
+ fn clone(&self) -> FILE { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos_t {}
+impl ::dox::Clone for fpos_t {
+ fn clone(&self) -> fpos_t { *self }
+}
extern {
pub fn isalnum(c: c_int) -> c_int;
@@ -4103,6 +4127,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
diff --git a/src/lib.rs b/src/lib.rs
index 86ab9b1..2300e82 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -158,6 +158,7 @@
#![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))]
+#![deny(missing_copy_implementations)]
#[cfg(all(not(cross_platform_docs), feature = "use_std"))]
extern crate std as core;
diff --git a/src/redox/mod.rs b/src/redox/mod.rs
index cfe7fd6..82782bc 100644
--- a/src/redox/mod.rs
+++ b/src/redox/mod.rs
@@ -221,8 +221,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
+impl ::dox::Copy for FILE {}
+impl ::dox::Clone for FILE {
+ fn clone(&self) -> FILE { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos_t {}
+impl ::dox::Clone for fpos_t {
+ fn clone(&self) -> fpos_t { *self }
+}
// intentionally not public, only used for fd_set
cfg_if! {
@@ -385,6 +393,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
diff --git a/src/sgx.rs b/src/sgx.rs
index 0451333..1d5ca21 100644
--- a/src/sgx.rs
+++ b/src/sgx.rs
@@ -43,6 +43,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
diff --git a/src/switch.rs b/src/switch.rs
index e2d9b49..89e259e 100644
--- a/src/switch.rs
+++ b/src/switch.rs
@@ -45,6 +45,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index bb48d22..59394c6 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -36,6 +36,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
s! {
pub struct aiocb {
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 75afeb2..ebbebc4 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -19,6 +19,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
+impl ::dox::Copy for sem {}
+impl ::dox::Clone for sem {
+ fn clone(&self) -> sem { *self }
+}
s! {
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index a402269..304bdeb 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -18,6 +18,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
s! {
pub struct glob_t {
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index dfe2051..764174d 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -15,8 +15,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
+impl ::dox::Copy for sem {}
+impl ::dox::Clone for sem {
+ fn clone(&self) -> sem { *self }
+}
s! {
pub struct sigaction {
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index a7fdffd..94d8039 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -33,6 +33,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
s! {
pub struct sockaddr {
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index bcd16f8..409f283 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -43,8 +43,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum DIR {}
+impl ::dox::Copy for DIR {}
+impl ::dox::Clone for DIR {
+ fn clone(&self) -> DIR { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum locale_t {}
+impl ::dox::Copy for locale_t {}
+impl ::dox::Clone for locale_t {
+ fn clone(&self) -> locale_t { *self }
+}
s! {
pub struct group {
@@ -369,8 +377,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
+impl ::dox::Copy for FILE {}
+impl ::dox::Clone for FILE {
+ fn clone(&self) -> FILE { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos_t {}
+impl ::dox::Clone for fpos_t {
+ fn clone(&self) -> fpos_t { *self }
+}
extern {
pub fn isalnum(c: c_int) -> c_int;
@@ -1160,6 +1176,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
diff --git a/src/unix/notbsd/emscripten.rs b/src/unix/notbsd/emscripten.rs
index 069631c..9bf2026 100644
--- a/src/unix/notbsd/emscripten.rs
+++ b/src/unix/notbsd/emscripten.rs
@@ -37,6 +37,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos64_t {}
+impl ::dox::Clone for fpos64_t {
+ fn clone(&self) -> fpos64_t { *self }
+}
s! {
pub struct dirent {
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 3150887..443e7d5 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -40,6 +40,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos64_t {}
+impl ::dox::Clone for fpos64_t {
+ fn clone(&self) -> fpos64_t { *self }
+}
s! {
pub struct rlimit64 {
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 7913508..51414e6 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -10,6 +10,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
s! {
pub struct sockaddr {
diff --git a/src/unix/solaris/mod.rs b/src/unix/solaris/mod.rs
index c10f4c1..c9a53e1 100644
--- a/src/unix/solaris/mod.rs
+++ b/src/unix/solaris/mod.rs
@@ -38,6 +38,10 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
s! {
pub struct sockaddr {
diff --git a/src/unix/uclibc/mod.rs b/src/unix/uclibc/mod.rs
index e062004..bb31419 100644
--- a/src/unix/uclibc/mod.rs
+++ b/src/unix/uclibc/mod.rs
@@ -26,9 +26,17 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos64_t {}
+impl ::dox::Clone for fpos64_t {
+ fn clone(&self) -> fpos64_t { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
s! {
pub struct sockaddr {
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index 9deaf9b..25a381a 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -49,6 +49,10 @@
pub type ino_t = u16;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
+impl ::dox::Copy for timezone {}
+impl ::dox::Clone for timezone {
+ fn clone(&self) -> timezone { *self }
+}
pub type time64_t = i64;
pub type SOCKET = ::uintptr_t;
@@ -204,8 +208,16 @@
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
+impl ::dox::Copy for FILE {}
+impl ::dox::Clone for FILE {
+ fn clone(&self) -> FILE { *self }
+}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // TODO: fill this out with a struct
+impl ::dox::Copy for fpos_t {}
+impl ::dox::Clone for fpos_t {
+ fn clone(&self) -> fpos_t { *self }
+}
extern {
pub fn isalnum(c: c_int) -> c_int;
@@ -429,6 +441,7 @@
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
+ #[allow(missing_copy_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]