Skip to content

crate: change padding fields to use Padding - #5435

Open
dybucc wants to merge 2 commits into
rust-lang:mainfrom
dybucc:add-padding-remaining
Open

crate: change padding fields to use Padding#5435
dybucc wants to merge 2 commits into
rust-lang:mainfrom
dybucc:add-padding-remaining

Conversation

@dybucc

@dybucc dybucc commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Description

Attempts to change whichever padding fields didn’t already use our custom Padding type. Closes #1453.

Originally, this description didn't contain the command used for searching the files. Other than the search results found by the following shell command, each of those files was manually inspected.

rg -g "src/**/*.rs" -s -n -e "pad|res(erve(d)?)?|unuse(d)?|fill(er)?|spare"

A split PR with changes to the public field lives now at #5444.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard doc comment
  • Tested locally (cargo test -p libc-test --target mytarget); especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in an OpenBSD module

cc @semarie

Some changes occurred in a solarish module

cc @jclulow, @pfmooney

Some changes occurred in an Android module

cc @maurer

Some changes occurred in a NetBSD-like module

cc @semarie

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you split this into separate commits?

  1. Changes to fields that are already private
  2. Changes to fields that are deprecated
  3. Changes to fields that are public (preferably a separate PR for labels)

That way I can backport the first two but hold off on the last one. I know our policy technically does allow us to change them, but some of these are pretty popular structs so I'd like to be a bit cautious anyway.

View changes since this review

@rustbot

rustbot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot

This comment has been minimized.

Replace the types of private padding fields with our custom `Padding`
type. This has been in use for some time, but there are still remnants
left from before the `Padding` type was a thing.
@dybucc
dybucc force-pushed the add-padding-remaining branch from 7b8c9ca to 7ef72d4 Compare August 28, 2026 14:32
@rustbot

rustbot commented Aug 28, 2026

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.

Replace types of padding fields that were deprecated for the `Padding`
type. The deprecation warnings have been there for more than 6 years, so
it's fine to act on them now.

Make afore-mentioned padding fields private.
@dybucc
dybucc force-pushed the add-padding-remaining branch from 7ef72d4 to 7d73557 Compare August 28, 2026 16:39
@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 28, 2026
@dybucc

dybucc commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

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.

Wrap padding fields in Padding(MaybeUninit<T>)

3 participants