Use Padding and make public padding fields private - #5444
Conversation
988168b to
e75fae0
Compare
This comment has been minimized.
This comment has been minimized.
Padding and make private public padding fieldsPadding and make private public padding fields
This comment has been minimized.
This comment has been minimized.
|
@rustbot author since that's in the queue not and there's a conflict |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
e75fae0 to
1373c63
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Padding and make private public padding fieldsPadding and make public padding fields private
There was a problem hiding this comment.
Looks good but needs a rebase since it is, of course, conflict-y
@rustbot author
| pub uc_mcontext: mcontext_t, | ||
| #[cfg(target_os = "illumos")] | ||
| pub uc_brand_data: [*mut c_void; 3], | ||
| uc_filler3: Padding<[c_long; 3]>, |
There was a problem hiding this comment.
Could you mention this correction in the commit message?
- Change public padding fields to be both private and use the `Padding` type. This has already been the norm for some time now, but there was still some cruft left. This patch finishes up the work, though this comes at the cost of breaking changes. - Change `uc_brand_data` field in Illumos to use `c_long` instead of `*mut c_void` as padding type. See [^1]. The name of the field also changed but that is irrelevant as it was already private before this patch. [^1]: <https://github.com/illumos/illumos-gate/blob/de1199e40761fcb5ed5cf82b16414ce4e4840999/usr/src/uts/intel/sys/ucontext.h#L89-L95>
1373c63 to
382d959
Compare
|
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 Since some of these changes are necessary to prevent Undefined Behavior, as reported in bytecodealliance/rustix#1668 should they be considered for backporting? |
|
@dybucc Once this is merged, I think making deprecated fields use |
Not backporting, bug in rustix bytecodealliance/rustix#1668 (comment) |
Description
Stems from #5435, but contains only the parts of the
patchset that affect currently public record fields.
Checklist
libc-test/semverhave been updated*LASTor*MAXhave thestandard doc comment
cargo test -p libc-test --target mytarget);especially relevant for platforms that may not be checked in CI