Guarantee alignment of fixed-width integer primitives#2205
Guarantee alignment of fixed-width integer primitives#2205joshlf wants to merge 4 commits intorust-lang:masterfrom
Conversation
|
Thanks. I pushed a clarification and separated out the rules. Clearly we want to guarantee this for fixed-width integers of the same size. @rfcbot fcp merge lang |
|
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
The purpose of the existing `layout.primitive.align` rule is to state that the alignment of primitives is platform-specific. Adding a separate alignment guarantee for integers overloads this a bit. Let's instead separate out the rules; we'll rename the existing rule since there are now two rules speaking to alignment.
Let's make this wording a bit more clear, and let's fix the em dash to use `---` since that's what our renderer expects.
|
Good to see this being specifically about for the stated @rfcbot reviewed |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Follows up on #2200 (comment)
As an optional extension, we could consider guaranteeing equality between the alignments of:
u32andcharu32andf32u64andf64Those equalities strike me as less important, and I'm not sure if they're even valid (ie, whether they hold on all platforms).