Skip to content

type-layout: rewrite #[repr(C)] struct layout algorithm#2243

Open
DanielEScherzer wants to merge 1 commit into
rust-lang:masterfrom
DanielEScherzer:type-layout-algo
Open

type-layout: rewrite #[repr(C)] struct layout algorithm#2243
DanielEScherzer wants to merge 1 commit into
rust-lang:masterfrom
DanielEScherzer:type-layout-algo

Conversation

@DanielEScherzer
Copy link
Copy Markdown
Contributor

@DanielEScherzer DanielEScherzer commented Apr 28, 2026

Make the code actual compile by defining types, not using a variable named struct, adding mut where needed, etc.

Properly handle the max() alignment call returning Option<usize> rather than usize by using 1 for the alignment if there are no fields.

Add comments with the parts of the algorithm that are represented by the statements.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Apr 28, 2026
@DanielEScherzer DanielEScherzer force-pushed the type-layout-algo branch 6 times, most recently from d49cb73 to 98e21c5 Compare May 5, 2026 19:32
@DanielEScherzer

This comment was marked as resolved.

@DanielEScherzer DanielEScherzer marked this pull request as draft May 5, 2026 20:24
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label May 5, 2026
Make the code actual compile by defining types, not using a variable named
`struct`, adding `mut` where needed, etc.

Properly handle the `max()` alignment call returning `Option<usize>` rather
than `usize` by using 1 for the alignment if there are no fields.

Add comments with the parts of the algorithm that are represented by the
statements.
@DanielEScherzer DanielEScherzer marked this pull request as ready for review May 26, 2026 18:55
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label May 26, 2026
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