diff options
author | Alan Somers <asomers@gmail.com> | 2020-05-16 15:55:30 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2020-05-16 15:55:30 -0600 |
commit | b9203336208378bedb39df124f2e8e64383ef4fc (patch) | |
tree | a53cc4b3eaee8dc3de496857785438780e0686c0 /src/poll.rs | |
parent | 465a8f73134de0eec1bf28c749cc89cece0c7a1a (diff) | |
download | nix-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/poll.rs')
-rw-r--r-- | src/poll.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/poll.rs b/src/poll.rs index 15bafe2d..fbdd09de 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -17,7 +17,7 @@ use errno::Errno; /// /// After a call to `poll` or `ppoll`, the events that occured can be /// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. -#[repr(C)] +#[repr(transparent)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct PollFd { pollfd: libc::pollfd, |