rust-lang / rust-lang/reference
Define the properties of Padding
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
We don't have a good explanation of the properties of padding. Currently we talk about it in two places:
- Type layout; It's pointed out that a type can have alignment padding that adds to the size.
- Added in #852, it's pointed out that it can be set as uninitialized.
I think padding should probably be described in the type layout chapter.
My question though, other than being an unnameable psuedo-field that can theoretically have any value, does it have any other properties? E.g., can they be repurposed by enums to do niche optimizations (making it unsafe to set the value)? Other restrictions?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the type layout chapter and the existing discussion of padding added in #852. Determine the agreed properties of padding, including whether enum niche optimizations or other restrictions affect it. Done means the behavior is settled and clearly documented in the appropriate part of the Reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100