From f3684584c99b8048cbfb056346dba34328e3a4f9 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Wed, 23 Jan 2019 07:23:09 -0800 Subject: Check for Copy impls for all types --- src/unix/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/unix/mod.rs') diff --git a/src/unix/mod.rs b/src/unix/mod.rs index bcd16f83ef..409f2835fd 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -43,8 +43,16 @@ pub type cc_t = ::c_uchar; #[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_if! { #[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 @@ cfg_if! { // 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)] -- cgit v1.2.1