Skip to content

Commit a063a59

Browse files
gnzlbgalexcrichton
authored andcommitted
remove clone impls (rust-lang#389)
Closes rust-lang#386 .
1 parent 8b5843e commit a063a59

File tree

4 files changed

+3
-28
lines changed

4 files changed

+3
-28
lines changed

coresimd/macros.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,9 @@ macro_rules! types {
77
pub struct $name:ident($($fields:tt)*);
88
)*) => ($(
99
$(#[$doc])*
10-
#[derive(Copy, Debug)]
10+
#[derive(Copy, Clone, Debug)]
1111
#[allow(non_camel_case_types)]
1212
#[repr(simd)]
1313
pub struct $name($($fields)*);
14-
15-
#[cfg_attr(feature = "cargo-clippy", allow(expl_impl_clone_on_copy))]
16-
impl ::clone::Clone for $name {
17-
#[inline] // currently needed for correctness
18-
fn clone(&self) -> $name {
19-
*self
20-
}
21-
}
2214
)*)
2315
}

coresimd/ppsv/api/bool_vectors.rs

-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44
/// Minimal interface: all packed SIMD boolean vector types implement this.
55
macro_rules! impl_bool_minimal {
66
($id:ident, $elem_ty:ident, $elem_count:expr, $($elem_name:ident),+) => {
7-
8-
#[cfg_attr(feature = "cargo-clippy", allow(expl_impl_clone_on_copy))]
9-
impl ::clone::Clone for $id {
10-
#[inline] // currently needed for correctness
11-
fn clone(&self) -> Self {
12-
*self
13-
}
14-
}
15-
167
impl $id {
178
/// Creates a new instance with each vector elements initialized
189
/// with the provided values.

coresimd/ppsv/api/minimal.rs

-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
/// Minimal interface: all packed SIMD vector types implement this.
55
macro_rules! impl_minimal {
66
($id:ident, $elem_ty:ident, $elem_count:expr, $($elem_name:ident),+) => {
7-
#[cfg_attr(feature = "cargo-clippy", allow(expl_impl_clone_on_copy))]
8-
impl ::clone::Clone for $id {
9-
#[inline] // currently needed for correctness
10-
fn clone(&self) -> Self {
11-
*self
12-
}
13-
}
14-
157
impl $id {
168
/// Creates a new instance with each vector elements initialized
179
/// with the provided values.

coresimd/ppsv/api/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
macro_rules! define_ty {
6060
($id:ident, $($elem_tys:ident),+ | $(#[$doc:meta])*) => {
6161
$(#[$doc])*
62-
#[repr(simd)]
63-
#[derive(Copy, Debug, /*FIXME:*/ PartialOrd)]
62+
#[repr(simd)]
63+
#[derive(Copy, Clone, Debug, /*FIXME:*/ PartialOrd)]
6464
#[allow(non_camel_case_types)]
6565
pub struct $id($($elem_tys),*);
6666
}

0 commit comments

Comments
 (0)