Skip to content

Commit

Permalink
remove clone impls (rust-lang#389)
Browse files Browse the repository at this point in the history
Closes rust-lang#386 .
  • Loading branch information
gnzlbg authored and alexcrichton committed Mar 20, 2018
1 parent 8b5843e commit a063a59
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
10 changes: 1 addition & 9 deletions coresimd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
)*)
}
9 changes: 0 additions & 9 deletions coresimd/ppsv/api/bool_vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions coresimd/ppsv/api/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions coresimd/ppsv/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),*);
}
Expand Down

0 comments on commit a063a59

Please sign in to comment.