Skip to content

Update repr to use the attribute template #1899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 30, 2025

New rules:

  • layout.repr.attribute.intro
  • layout.repr.attribute.syntax
  • layout.repr.attribute.allowed-positions
  • layout.repr.attribute.duplicates
  • layout.repr.attribute.combinations
  • layout.repr.attribute.combinations.transparent
  • layout.repr.attribute.combinations.rust
  • layout.repr.attribute.combinations.primitive
  • layout.repr.attribute.combinations.primitive-c
  • layout.repr.attribute.combinations.primitive-unit-only
  • layout.repr.attribute.combinations.align-packed
  • layout.repr.attribute.combinations.align-packed-rust-or-c
  • layout.repr.attribute.combinations.align-max
  • layout.repr.attribute.combinations.packed-min
  • layout.repr.attribute.combinations.rust-c-dupe

Renamed rules:

  • layout.repr.align-packed is now layout.repr.alignment.intro
  • layout.repr.primitive.constraint split into layout.repr.primitive.enum-only and layout.repr.primitive.zero-variant
  • layout.repr.alignment.enum is now layout.repr.alignment.align-enum
  • layout.repr.alignment.constraint-exclusive split into layout.repr.alignment.pack-transitive-aligned and layout.repr.alignment.packed-enum
  • layout.repr.transparent.constraint-exclusive moved to layout.repr.attribute.combinations

ehuss added 6 commits June 30, 2025 12:56
I can't really think of a good place to put this, but it didn't really
fit with the rule it currently was in.
This more or less repeats what is already said in
layout.repr.alignment.intro where it explains that they are modifiers
that affect a representation.
This consolidates the rules for how repr values can be combined. This
adds a few previously undocumented combinations, and I think all
permutations should now be covered.
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants