Skip to content

Update repr to use the attribute template - #1899

Open
ehuss wants to merge 7 commits into
rust-lang:masterfrom
ehuss:repr
Open

Update repr to use the attribute template#1899
ehuss wants to merge 7 commits into
rust-lang:masterfrom
ehuss:repr

Conversation

@ehuss

Copy link
Copy Markdown
Contributor

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

@rustbotrustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
@rustbot

This comment has been minimized.

Comment threadsrc/type-layout.md Outdated
Comment threadsrc/type-layout.md Outdated
Comment threadsrc/type-layout.md Outdated
@rustbot

This comment has been minimized.

@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master 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.

ehussand others added 7 commits January 27, 2026 14:46
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.
Co-authored-by: Tshepang Mbambo <hopsi@tuta.io>
@rustbot

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #2293) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-reviewStatus: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ehuss@rustbot@tshepang