From db819cb9320d55afc34085f7ea2b16f39e715cf4 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Tue, 20 Mar 2018 16:14:26 +0100 Subject: [PATCH] remove clone impls (#389) Closes #386 . --- library/stdarch/coresimd/macros.rs | 10 +--------- library/stdarch/coresimd/ppsv/api/bool_vectors.rs | 9 --------- library/stdarch/coresimd/ppsv/api/minimal.rs | 8 -------- library/stdarch/coresimd/ppsv/api/mod.rs | 4 ++-- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/library/stdarch/coresimd/macros.rs b/library/stdarch/coresimd/macros.rs index 5d28abd41f48..343f425c1aba 100644 --- a/library/stdarch/coresimd/macros.rs +++ b/library/stdarch/coresimd/macros.rs @@ -7,17 +7,9 @@ macro_rules! types { pub struct $name:ident($($fields:tt)*); )*) => ($( $(#[$doc])* - #[derive(Copy, Debug)] + #[derive(Copy, Clone, Debug)] #[allow(non_camel_case_types)] #[repr(simd)] pub struct $name($($fields)*); - - #[cfg_attr(feature = "cargo-clippy", allow(expl_impl_clone_on_copy))] - impl ::clone::Clone for $name { - #[inline] // currently needed for correctness - fn clone(&self) -> $name { - *self - } - } )*) } diff --git a/library/stdarch/coresimd/ppsv/api/bool_vectors.rs b/library/stdarch/coresimd/ppsv/api/bool_vectors.rs index cde5360e7fde..ba55aca1b664 100644 --- a/library/stdarch/coresimd/ppsv/api/bool_vectors.rs +++ b/library/stdarch/coresimd/ppsv/api/bool_vectors.rs @@ -4,15 +4,6 @@ /// Minimal interface: all packed SIMD boolean vector types implement this. macro_rules! impl_bool_minimal { ($id:ident, $elem_ty:ident, $elem_count:expr, $($elem_name:ident),+) => { - - #[cfg_attr(feature = "cargo-clippy", allow(expl_impl_clone_on_copy))] - impl ::clone::Clone for $id { - #[inline] // currently needed for correctness - fn clone(&self) -> Self { - *self - } - } - impl $id { /// Creates a new instance with each vector elements initialized /// with the provided values. diff --git a/library/stdarch/coresimd/ppsv/api/minimal.rs b/library/stdarch/coresimd/ppsv/api/minimal.rs index d833a2af67a8..b5aba454daed 100644 --- a/library/stdarch/coresimd/ppsv/api/minimal.rs +++ b/library/stdarch/coresimd/ppsv/api/minimal.rs @@ -4,14 +4,6 @@ /// Minimal interface: all packed SIMD vector types implement this. macro_rules! impl_minimal { ($id:ident, $elem_ty:ident, $elem_count:expr, $($elem_name:ident),+) => { - #[cfg_attr(feature = "cargo-clippy", allow(expl_impl_clone_on_copy))] - impl ::clone::Clone for $id { - #[inline] // currently needed for correctness - fn clone(&self) -> Self { - *self - } - } - impl $id { /// Creates a new instance with each vector elements initialized /// with the provided values. diff --git a/library/stdarch/coresimd/ppsv/api/mod.rs b/library/stdarch/coresimd/ppsv/api/mod.rs index 1ddf30a1a985..00fd73d9abd9 100644 --- a/library/stdarch/coresimd/ppsv/api/mod.rs +++ b/library/stdarch/coresimd/ppsv/api/mod.rs @@ -59,8 +59,8 @@ macro_rules! define_ty { ($id:ident, $($elem_tys:ident),+ | $(#[$doc:meta])*) => { $(#[$doc])* - #[repr(simd)] - #[derive(Copy, Debug, /*FIXME:*/ PartialOrd)] + #[repr(simd)] + #[derive(Copy, Clone, Debug, /*FIXME:*/ PartialOrd)] #[allow(non_camel_case_types)] pub struct $id($($elem_tys),*); }