diff --git a/ci/style.rs b/ci/style.rs index dcb3536ec30bab51411c6540a6f7c907a43599f7..79574eb44e18d67438f71354469b5f25b31dc3e7 100644 --- a/ci/style.rs +++ b/ci/style.rs @@ -134,6 +134,9 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) { instead of #[cfg]"); } } + if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) { + err.error(path, i, "impl ::Copy and ::Clone manually"); + } let line = line.trim_start(); let is_pub = line.starts_with("pub "); diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 166134ec0b24384955f7b050508028e8e4c49e39..44232e98cbe896938eabf8650325ac76f3befdc3 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -317,7 +317,6 @@ cfg_if! { if #[cfg(libc_union)] { // Internal, for casts to access union fields #[repr(C)] - #[derive(Copy,Clone)] struct sifields_sigchld { si_pid: ::pid_t, si_uid: ::uid_t, @@ -325,6 +324,12 @@ cfg_if! { si_utime: ::c_long, si_stime: ::c_long, } + impl ::Copy for sifields_sigchld {} + impl ::Clone for sifields_sigchld { + fn clone(&self) -> sifields_sigchld { + *self + } + } // Internal, for casts to access union fields #[repr(C)]