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

[Merged by Bors] - Mark TableRow and TableId as repr(transparent) #7166

Closed

Conversation

james7132
Copy link
Member

@james7132 james7132 commented Jan 11, 2023

Objective

Following #6681, both TableRow and TableId are now part of EntityLocation. However, the safety invariant on EntityLocation requires that all of the constituent fields are repr(transprent) or repr(C) and the bit pattern of all 1s must be valid. This is not true for TableRow and TableId currently.

Solution

Mark TableRow and TableId to satisfy the safety requirement. Add safety comments on ArchetypeId, ArchetypeRow, TableId and TableRow.

@james7132 james7132 added A-ECS Entities, components, systems, and events P-Unsound A bug that results in undefined compiler behavior labels Jan 11, 2023
@alice-i-cecile alice-i-cecile added this to the 0.10 milestone Jan 11, 2023
Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

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

lol

@BoxyUwU BoxyUwU added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 11, 2023
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jan 11, 2023
# Objective
Following #6681, both `TableRow` and `TableId` are now part of `EntityLocation`. However, the safety invariant on `EntityLocation` requires that all of the constituent fields are `repr(transprent)` or `repr(C)` and the bit pattern of all 1s must be valid. This is not true for `TableRow` and `TableId` currently.

## Solution
Mark `TableRow` and `TableId` to satisfy the safety requirement. Add safety comments on `ArchetypeId`, `ArchetypeRow`, `TableId` and `TableRow`.
@bors bors bot changed the title Mark TableRow and TableId as repr(transparent) [Merged by Bors] - Mark TableRow and TableId as repr(transparent) Jan 11, 2023
@bors bors bot closed this Jan 11, 2023
@james7132 james7132 deleted the entity-location-parts-repr branch January 20, 2023 01:12
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective
Following bevyengine#6681, both `TableRow` and `TableId` are now part of `EntityLocation`. However, the safety invariant on `EntityLocation` requires that all of the constituent fields are `repr(transprent)` or `repr(C)` and the bit pattern of all 1s must be valid. This is not true for `TableRow` and `TableId` currently.

## Solution
Mark `TableRow` and `TableId` to satisfy the safety requirement. Add safety comments on `ArchetypeId`, `ArchetypeRow`, `TableId` and `TableRow`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective
Following bevyengine#6681, both `TableRow` and `TableId` are now part of `EntityLocation`. However, the safety invariant on `EntityLocation` requires that all of the constituent fields are `repr(transprent)` or `repr(C)` and the bit pattern of all 1s must be valid. This is not true for `TableRow` and `TableId` currently.

## Solution
Mark `TableRow` and `TableId` to satisfy the safety requirement. Add safety comments on `ArchetypeId`, `ArchetypeRow`, `TableId` and `TableRow`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events P-Unsound A bug that results in undefined compiler behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants