Skip to content

Commit 628373f

Browse files
committed
'derive(Copy)' needs Clone now
1 parent 7d48278 commit 628373f

File tree

15 files changed

+29
-31
lines changed

15 files changed

+29
-31
lines changed

src/fcntl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod ffi {
1919
use libc::{c_int, c_short, off_t, pid_t};
2020

2121
#[repr(C)]
22-
#[derive(Copy)]
22+
#[derive(Clone, Copy)]
2323
pub struct flock {
2424
pub l_type: c_short,
2525
pub l_whence: c_short,
@@ -47,7 +47,7 @@ mod ffi {
4747
use libc::{c_int, c_short, off_t, pid_t};
4848

4949
#[repr(C)]
50-
#[derive(Copy)]
50+
#[derive(Clone, Copy)]
5151
pub struct flock {
5252
pub l_start: off_t,
5353
pub l_len: off_t,

src/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub type CpuMask = c_ulong;
8989

9090
// Structure representing the CPU set to apply
9191
#[repr(C)]
92-
#[derive(Copy)]
92+
#[derive(Clone, Copy)]
9393
pub struct CpuSet {
9494
cpu_mask: [CpuMask; cpuset_attribs::CPU_SETSIZE/cpuset_attribs::CPU_MASK_BITS]
9595
}

src/sys/epoll.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl fmt::Debug for EpollEventKind {
7070
}
7171
}
7272

73-
#[derive(Copy)]
73+
#[derive(Clone, Copy)]
7474
#[repr(C)]
7575
pub enum EpollOp {
7676
EpollCtlAdd = 1,
@@ -94,7 +94,7 @@ fn test_epoll_event_size() {
9494
}
9595

9696
#[cfg(any(not(target_os = "android"), target_arch = "x86_64"))]
97-
#[derive(Copy)]
97+
#[derive(Clone, Copy)]
9898
#[repr(C, packed)]
9999
pub struct EpollEvent {
100100
pub events: EpollEventKind,

src/sys/event.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod ffi {
1313
pub use libc::{c_int, c_void, uintptr_t, intptr_t, timespec};
1414
use super::{EventFilter, EventFlag, FilterFlag};
1515

16-
#[derive(Copy)]
16+
#[derive(Clone, Copy)]
1717
#[repr(C)]
1818
pub struct kevent {
1919
pub ident: uintptr_t, // 8
@@ -40,7 +40,7 @@ mod ffi {
4040
}
4141

4242
#[repr(i16)]
43-
#[derive(Copy, Debug, PartialEq)]
43+
#[derive(Clone, Copy, Debug, PartialEq)]
4444
pub enum EventFilter {
4545
EVFILT_READ = -1,
4646
EVFILT_WRITE = -2,

src/sys/ioctl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub use self::IoctlArg::*;
88
mod ffi {
99
use libc::c_ushort;
1010

11-
#[derive(Copy, Debug)]
11+
#[derive(Clone, Copy, Debug)]
1212
pub struct Winsize {
1313
pub ws_row: c_ushort,
1414
pub ws_col: c_ushort,

src/sys/signal.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub mod signal {
9696
// actually a giant union. Currently we're only interested in these fields,
9797
// however.
9898
#[repr(C)]
99-
#[derive(Copy)]
99+
#[derive(Clone, Copy)]
100100
pub struct siginfo {
101101
si_signo: libc::c_int,
102102
si_errno: libc::c_int,
@@ -117,14 +117,14 @@ pub mod signal {
117117

118118
#[repr(C)]
119119
#[cfg(target_pointer_width = "32")]
120-
#[derive(Copy)]
120+
#[derive(Clone, Copy)]
121121
pub struct sigset_t {
122122
__val: [libc::c_ulong; 32],
123123
}
124124

125125
#[repr(C)]
126126
#[cfg(target_pointer_width = "64")]
127-
#[derive(Copy)]
127+
#[derive(Clone, Copy)]
128128
pub struct sigset_t {
129129
__val: [libc::c_ulong; 16],
130130
}
@@ -249,7 +249,7 @@ pub mod signal {
249249
// This structure has more fields, but we're not all that interested in
250250
// them.
251251
#[repr(C)]
252-
#[derive(Copy)]
252+
#[derive(Clone, Copy)]
253253
pub struct siginfo {
254254
pub si_signo: libc::c_int,
255255
pub si_errno: libc::c_int,
@@ -297,7 +297,7 @@ mod ffi {
297297
}
298298
}
299299

300-
#[derive(Copy)]
300+
#[derive(Clone, Copy)]
301301
pub struct SigSet {
302302
sigset: sigset_t
303303
}

src/sys/socket/addr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl fmt::Display for Ipv4Addr {
275275
*
276276
*/
277277

278-
#[derive(Copy)]
278+
#[derive(Clone, Copy)]
279279
pub struct Ipv6Addr(pub libc::in6_addr);
280280

281281
impl Ipv6Addr {

src/sys/socket/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct sockaddr_storage {
5757
pub __ss_pad2: [u8; 120],
5858
}
5959

60-
#[derive(Copy, PartialEq, Eq, Debug, FromPrimitive)]
60+
#[derive(Clone, Copy, PartialEq, Eq, Debug, FromPrimitive)]
6161
#[repr(i32)]
6262
pub enum SockType {
6363
Stream = consts::SOCK_STREAM,
@@ -248,7 +248,7 @@ pub fn sendto(fd: RawFd, buf: &[u8], addr: &SockAddr, flags: SockMessageFlags) -
248248
}
249249

250250
#[repr(C)]
251-
#[derive(Copy, Debug)]
251+
#[derive(Clone, Copy, Debug)]
252252
pub struct linger {
253253
pub l_onoff: c_int,
254254
pub l_linger: c_int

src/sys/socket/multicast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use libc::in_addr;
33
use std::fmt;
44

55
#[repr(C)]
6-
#[derive(Copy)]
6+
#[derive(Clone, Copy)]
77
pub struct ip_mreq {
88
pub imr_multiaddr: in_addr,
99
pub imr_interface: in_addr,

src/sys/socket/sockopt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ macro_rules! sockopt_impl {
2222
};
2323

2424
($name:ident, $flag:path, $get_ty:ty, $getter:ty, $set_ty:ty, $setter:ty) => {
25-
#[derive(Copy, Debug)]
25+
#[derive(Clone, Copy, Debug)]
2626
pub struct $name;
2727

2828
impl<'a> SockOpt for $name {

0 commit comments

Comments
 (0)