Skip to content

adding SUN_LEN macro to linux glibc/musl#4269

Merged
tgross35 merged 2 commits into
rust-lang:mainfrom
devnexen:linux_sun_len
Dec 3, 2025
Merged

adding SUN_LEN macro to linux glibc/musl#4269
tgross35 merged 2 commits into
rust-lang:mainfrom
devnexen:linux_sun_len

Conversation

@devnexen

Copy link
Copy Markdown
Contributor

@rustbot

rustbot commented Feb 15, 2025

Copy link
Copy Markdown
Collaborator

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@tgross35

Copy link
Copy Markdown
Contributor

I'm just going to mark this blocked since I don't yet know what to do without offset_of!. I don't think we want to add a new config specific for this macro, but maybe something like a recent-msrv cargo feature is possible.

@rustbot blocked

@tgross35

Copy link
Copy Markdown
Contributor

Added an offset_of! macro in 1808393, this should be able to go forward with that.

@rustbot author

@rustbot

rustbot commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot

This comment has been minimized.

@devnexen devnexen force-pushed the linux_sun_len branch 6 times, most recently from 8891822 to 83539f3 Compare October 30, 2025 06:26
@devnexen

Copy link
Copy Markdown
Contributor Author

@rustbot ready

Comment thread src/unix/linux_like/linux/mod.rs
Comment thread src/macros.rs
let fptr = unsafe { core::ptr::addr_of!((*ptr).$field) };
let off = (fptr as usize).checked_sub(ptr as usize).unwrap();
assert!(off <= core::mem::size_of::<$Ty>());
core::assert!(off <= core::mem::size_of::<$Ty>());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you could split macro changes to a separate commit that would be ideal (distinct changes in separate commits makes the backporting easier)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@devnexen the first commit still has some macro changes, and the second commit undoes part of the first. It should be split so that one commit does all the changes in macros.rs, then another commit does the rest.

(I'm happy to take care of this for you if you'd like, just don't like touching commit contents without asking)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

please proceed :)

- assert! access from core.
- nested unsafe raises an error on older rust compilers on CI.

[ re-split commits as authorized by the author, and update the commit
  summary - Trevor ]
@rustbot

rustbot commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be all set, thanks!

@tgross35 tgross35 enabled auto-merge December 3, 2025 06:42
@tgross35 tgross35 added this pull request to the merge queue Dec 3, 2025
Merged via the queue into rust-lang:main with commit 34d6637 Dec 3, 2025
97 of 99 checks passed
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Dec 28, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
- assert! access from core.
- nested unsafe raises an error on older rust compilers on CI.

[ re-split commits as authorized by the author, and update the commit
  summary - Trevor ]

(backport <rust-lang#4269>)
(cherry picked from commit c20475c)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
@tgross35 tgross35 mentioned this pull request Dec 28, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Dec 28, 2025
- assert! access from core.
- nested unsafe raises an error on older rust compilers on CI.

[ re-split commits as authorized by the author, and update the commit
  summary - Trevor ]

(backport <#4269>)
(cherry picked from commit c20475c)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-linux O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants