summaryrefslogtreecommitdiff
path: root/src/sys/socket/mod.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2020-05-16 15:55:30 -0600
committerAlan Somers <asomers@gmail.com>2020-05-16 15:55:30 -0600
commitb9203336208378bedb39df124f2e8e64383ef4fc (patch)
treea53cc4b3eaee8dc3de496857785438780e0686c0 /src/sys/socket/mod.rs
parent465a8f73134de0eec1bf28c749cc89cece0c7a1a (diff)
downloadnix-b9203336208378bedb39df124f2e8e64383ef4fc.zip
Apply `repr(transparent)` to several FFI types
repr(transparent) is required in order to safely cast between an FFI type and its NewType. This commit applies that attribute to PollFd, EpollEvent, IpMembershipRequest, Ipv6MembershipRequest, TimeVal, and IoVec. Fixes #1241
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r--src/sys/socket/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index 1f627614..52768c93 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -278,7 +278,7 @@ cfg_if! {
/// Request for multicast socket operations
///
/// This is a wrapper type around `ip_mreq`.
-#[repr(C)]
+#[repr(transparent)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct IpMembershipRequest(libc::ip_mreq);
@@ -297,7 +297,7 @@ impl IpMembershipRequest {
/// Request for ipv6 multicast socket operations
///
/// This is a wrapper type around `ipv6_mreq`.
-#[repr(C)]
+#[repr(transparent)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Ipv6MembershipRequest(libc::ipv6_mreq);