Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Aug 29, 2025

While we're here, always say "padding" instead of "inter-field padding",
as all kinds (structs, enums, and unions) can have trailing padding too.

As an example, the diff for
zerocopy-derive/tests/ui-stable/enum.stderr contains:

-error[E0277]: IntoBytes3 has inter-field padding
+error[E0277]: IntoBytes3 has 2 total byte(s) of padding

Closes #1717

@joshlf joshlf requested a review from jswrenn August 29, 2025 13:35
@joshlf joshlf force-pushed the padding-error-message branch from a6141d6 to a558df4 Compare August 29, 2025 13:38
@joshlf
Copy link
Member Author

joshlf commented Aug 29, 2025

@jswrenn Since we support unions and enums, perhaps we should just say "padding" instead of "inter-field padding"? Structs and enums can have trailing padding too, while unions can only have trailing padding.

EDIT: I'm just going to go ahead and make that change. Lmk if you think we should keep the old wording and I can revert.

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.75%. Comparing base (0e51bab) to head (ea806e0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2699   +/-   ##
=======================================
  Coverage   88.75%   88.75%           
=======================================
  Files          20       20           
  Lines        5343     5343           
=======================================
  Hits         4742     4742           
  Misses        601      601           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

While we're here, always say "padding" instead of "inter-field padding",
as all kinds (structs, enums, and unions) can have trailing padding too.

As an example, the diff for
`zerocopy-derive/tests/ui-stable/enum.stderr` contains:

-error[E0277]: `IntoBytes3` has inter-field padding
+error[E0277]: `IntoBytes3` has 2 total byte(s) of padding

Closes #1717
@joshlf joshlf force-pushed the padding-error-message branch from a558df4 to ea806e0 Compare August 29, 2025 13:48
@joshlf joshlf changed the title [derive] IntoBytes padding error says number of bytes [derive] IntoBytes padding error says number of bytes Aug 29, 2025
@joshlf joshlf enabled auto-merge August 29, 2025 13:50
Copy link
Collaborator

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

Very cool!

@joshlf joshlf added this pull request to the merge queue Aug 29, 2025
Merged via the queue into main with commit ca8f52f Aug 29, 2025
89 checks passed
@joshlf joshlf deleted the padding-error-message branch August 29, 2025 15:47
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.

IntoBytes padding error message should include the number of padding bytes

3 participants