From b9203336208378bedb39df124f2e8e64383ef4fc Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 16 May 2020 15:55:30 -0600 Subject: 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 --- src/sys/socket/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sys/socket') 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); -- cgit v1.2.3