Skip to content

Commit 293f1a9

Browse files
committed
make MsgHdr and MsgHdrMut repr(transparent) to allow legally obtaining libc::msghdr from those types
1 parent feac83a commit 293f1a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ impl TcpKeepalive {
562562
/// This wraps `msghdr` on Unix and `WSAMSG` on Windows. Also see [`MsgHdrMut`]
563563
/// for the variant used by `recvmsg(2)`.
564564
#[cfg(not(target_os = "redox"))]
565+
#[repr(transparent)]
565566
pub struct MsgHdr<'addr, 'bufs, 'control> {
566567
inner: sys::msghdr,
567568
#[allow(clippy::type_complexity)]
@@ -630,6 +631,7 @@ impl<'name, 'bufs, 'control> fmt::Debug for MsgHdr<'name, 'bufs, 'control> {
630631
/// This wraps `msghdr` on Unix and `WSAMSG` on Windows. Also see [`MsgHdr`] for
631632
/// the variant used by `sendmsg(2)`.
632633
#[cfg(not(target_os = "redox"))]
634+
#[repr(transparent)]
633635
pub struct MsgHdrMut<'addr, 'bufs, 'control> {
634636
inner: sys::msghdr,
635637
#[allow(clippy::type_complexity)]

0 commit comments

Comments
 (0)