Skip to content

cleanup: Mark private padding fields as Padding#4862

Merged
tgross35 merged 5 commits intorust-lang:mainfrom
3v1n0:fix-private-paddings
Dec 3, 2025
Merged

cleanup: Mark private padding fields as Padding#4862
tgross35 merged 5 commits intorust-lang:mainfrom
3v1n0:fix-private-paddings

Conversation

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented Dec 3, 2025

Description

We have more private fields that are padding areas that are currently
not marked as Padding, which is causing the generated Hash
and PartialEq implementations to take care of them wrongly.

Fix them

This is a pre-requisite and API-compatible version of

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

Some changes occurred in the Android module

cc @maurer

Some changes occurred in solarish module

cc @jclulow, @pfmooney

Some changes occurred in OpenBSD module

cc @semarie

@3v1n0 3v1n0 force-pushed the fix-private-paddings branch 2 times, most recently from c088a8f to dc20464 Compare December 3, 2025 02:09
@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

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.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Just one request about uninit, the rest LGTM!

3v1n0 added 4 commits December 3, 2025 06:16
It allows to uninitialize padding areas in const contextes.
We have more private fields that are padding areas that are currently
not marked as Padding, which is causing the generated Hash
and PartialEq implementations to take care of them wrongly.

Fix them
As previous commit, but tackle the *padding* fields
Some were already done, more were missing
@3v1n0 3v1n0 force-pushed the fix-private-paddings branch from dc20464 to 29b49bb Compare December 3, 2025 05:16
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Looks awesome, thank you!

@tgross35 tgross35 added this pull request to the merge queue Dec 3, 2025
Merged via the queue into rust-lang:main with commit 6383ad8 Dec 3, 2025
51 checks passed
@tgross35 tgross35 mentioned this pull request Dec 3, 2025
3 tasks
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
It allows to uninitialize padding areas in const contextes.

(backport <rust-lang#4862>)
(cherry picked from commit e40f470)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
We have more private fields that are padding areas that are currently
not marked as Padding, which is causing the generated Hash
and PartialEq implementations to take care of them wrongly.

Fix them

(backport <rust-lang#4862>)
(cherry picked from commit 69783f6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
As previous commit, but tackle the *padding* fields

(backport <rust-lang#4862>)
(cherry picked from commit 0745ad4)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
Some were already done, more were missing

(backport <rust-lang#4862>)
(cherry picked from commit e52c686)
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
It allows to uninitialize padding areas in const contextes.

(backport <#4862>)
(cherry picked from commit e40f470)
github-merge-queue bot pushed a commit that referenced this pull request Dec 28, 2025
We have more private fields that are padding areas that are currently
not marked as Padding, which is causing the generated Hash
and PartialEq implementations to take care of them wrongly.

Fix them

(backport <#4862>)
(cherry picked from commit 69783f6)
github-merge-queue bot pushed a commit that referenced this pull request Dec 28, 2025
As previous commit, but tackle the *padding* fields

(backport <#4862>)
(cherry picked from commit 0745ad4)
github-merge-queue bot pushed a commit that referenced this pull request Dec 28, 2025
Some were already done, more were missing

(backport <#4862>)
(cherry picked from commit e52c686)
github-merge-queue bot pushed a commit that referenced this pull request Dec 28, 2025
(backport <#4862>)
(cherry picked from commit 6383ad8)
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants