Skip to content

Conversation

@nerodono
Copy link
Contributor

Closes #633

This PR simply adds #[repr(transparent)] to corresponding types, without any methods for conversion on the types themselves.

@nerodono nerodono force-pushed the repr_transparent_msghdr branch from 22638c5 to fbf073d Compare January 13, 2026 05:25
@nerodono
Copy link
Contributor Author

Wrote improvised changelog, hope it's done the right way. By the way, after the merge, can you please release a patch version on crates.io? On my workplace, we decided to use this library for some low-level socket operations, and proposed fix would be required (practically speaking, it's not, since transmuting MsgHdr[Mut] into libc::msghdr won't do anything bad even without repr(transparent), but lack of this guarantee in the API feels wrong) and making git dependency would require to monitor socket2 releases to get rid of it.

@nerodono nerodono force-pushed the repr_transparent_msghdr branch from fbf073d to d2678ec Compare January 13, 2026 05:35
@Darksonn
Copy link
Collaborator

This is ok with me, but I think we usually do not add changelog entries for unreleased changes.

@nerodono
Copy link
Contributor Author

This is ok with me, but I think we usually do not add changelog entries for unreleased changes.

So, it's OK to simply not add changelog in this PR?

@Darksonn
Copy link
Collaborator

Yes. It will be done in bulk on release.

Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the part for the changelog, otherwise LGTM.

@nerodono nerodono force-pushed the repr_transparent_msghdr branch from d2678ec to 293f1a9 Compare January 13, 2026 09:06
@nerodono
Copy link
Contributor Author

You can remove the part for the changelog, otherwise LGTM.

Done.

@Thomasdezeeuw Thomasdezeeuw merged commit 3403a44 into rust-lang:master Jan 13, 2026
49 checks passed
@Thomasdezeeuw
Copy link
Collaborator

Thanks @nerodono

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MsgHdr[Mut] should be repr(transparent)

3 participants