don't derive Clone, but impl it

affected struct:
 - sockaddr_storage
 - sockaddr_un

apply the same method used for linux for:
 - bitrig/openbsd
 - freebsd
 - dragonfly
This commit is contained in:
Sébastien Marie 2015-04-02 13:34:40 +02:00
parent cf00fc4da9
commit 48b3def76c

View file

@ -863,13 +863,16 @@ pub mod bsd44 {
pub sa_data: [u8; 14],
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
pub __ss_align: i64,
pub __ss_pad2: [u8; 112],
}
impl ::core::clone::Clone for sockaddr_storage {
fn clone(&self) -> sockaddr_storage { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_in {
pub sin_len: u8,
@ -917,11 +920,14 @@ pub mod bsd44 {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
impl ::core::clone::Clone for sockaddr_un {
fn clone(&self) -> sockaddr_un { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
@ -1125,13 +1131,16 @@ pub mod bsd44 {
pub sa_data: [u8; 14],
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
pub __ss_align: i64,
pub __ss_pad2: [u8; 112],
}
impl ::core::clone::Clone for sockaddr_storage {
fn clone(&self) -> sockaddr_storage { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_in {
pub sin_len: u8,
@ -1179,11 +1188,14 @@ pub mod bsd44 {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
impl ::core::clone::Clone for sockaddr_un {
fn clone(&self) -> sockaddr_un { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
@ -1405,13 +1417,16 @@ pub mod bsd44 {
pub sa_data: [u8; 14],
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
pub __ss_pad2: i64,
pub __ss_pad3: [u8; 240],
}
impl ::core::clone::Clone for sockaddr_storage {
fn clone(&self) -> sockaddr_storage { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_in {
pub sin_len: u8,
@ -1459,11 +1474,14 @@ pub mod bsd44 {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
impl ::core::clone::Clone for sockaddr_un {
fn clone(&self) -> sockaddr_un { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,