Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark CompletionStatus as repr(transparent) to guarantee layout #46

Merged
merged 1 commit into from
Sep 24, 2021
Merged

Mark CompletionStatus as repr(transparent) to guarantee layout #46

merged 1 commit into from
Sep 24, 2021

Conversation

udoprog
Copy link
Contributor

@udoprog udoprog commented Apr 21, 2021

This is required to guarantee that the compiler won't fiddle with the layout of the struct so that a reference to one is compatible with another.

In practice I only think it's ever mattered for floats, but this asserts that it won't break in the future.

Copy link
Owner

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thank you!

@yoshuawuyts yoshuawuyts merged commit 200cc7b into yoshuawuyts:master Sep 24, 2021
@udoprog udoprog deleted the repr-transparent branch September 24, 2021 15:11
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.

2 participants