Skip to content

PhantomData: clearly document alignment of 1, add to glossary examples - #2375

Merged
traviscross merged 3 commits into
rust-lang:masterfrom
DanielEScherzer:phantomdata-1-zst
Oct 6, 2026
Merged

traviscross merged 3 commits into
rust-lang:masterfrom
DanielEScherzer:phantomdata-1-zst

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Contributor

No description provided.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 4, 2026
@DanielEScherzer

Copy link
Copy Markdown
Contributor Author

Guarantees were added in rust-lang/rust#104081 after going through FCP by T-libs-api (back when that team existed), so this shouldn't be adding any new guarantees (impossible to have an alignment of less than 1, so 1 is the minimum that was previously documented)

@DanielEScherzer DanielEScherzer changed the title PhantomData: clearly document alignment of 1, add to glossary as ZST and 1-ZST PhantomData: clearly document alignment of 1, add to glossary examples Oct 4, 2026
Comment thread src/special-types-and-traits.md Outdated
Comment thread src/glossary.md Outdated
Comment thread src/glossary.md Outdated
Test that PhantomData around a ZST and around a non-zero-sized non-1-aligned
type are both considered ZSTs.
Test that PhantomData around a 1-ZST and around a non-zero-sized non-1-aligned
type are both considered 1-ZSTs.
@traviscross
traviscross added this pull request to the merge queue Oct 6, 2026
@traviscross

Copy link
Copy Markdown
Contributor

Thanks @DanielEScherzer.

Merged via the queue into rust-lang:master with commit a88e9b8 Oct 6, 2026
8 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 6, 2026
@DanielEScherzer
DanielEScherzer deleted the phantomdata-1-zst branch October 6, 2026 18:57
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.

3 participants