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

Make BundleInfo's fields not pub(crate) #8068

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

james7132
Copy link
Member

Objective

While working on #8053, it became apparent that BundleInfo's pub(crate) fields are a potential soundness if the fields are accessed mutably after initialization.

Solution

Make them not pub(crate). Use inlined accessor functions instead.

@james7132 james7132 added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change P-Unsound A bug that results in undefined compiler behavior labels Mar 13, 2023
@james7132 james7132 added this to the 0.10.1 milestone Mar 13, 2023
@james7132 james7132 requested a review from JoJoJet March 13, 2023 03:21
@james7132
Copy link
Member Author

Is it breaking? The fields are pub(crate), no user facing interface was changed.

@alice-i-cecile alice-i-cecile 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 Mar 13, 2023
@alice-i-cecile
Copy link
Member

Yep I was wrong: this isn't breaking at all.

@james7132
Copy link
Member Author

Oh right the const on the ID. It's not technically breaking as it's only a gain of function and will not break any builds, but it is backwards-incompatible. I can remove that if need be.

@JoJoJet
Copy link
Member

JoJoJet commented Mar 13, 2023

I don't think this needs to be in the 0.10.1 milestone, this doesn't affect any consumers of bevy_ecs.

@alice-i-cecile alice-i-cecile removed this from the 0.10.1 milestone Mar 13, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 13, 2023
Merged via the queue into bevyengine:main with commit dcc0edf Mar 13, 2023
@james7132 james7132 deleted the less-pub-bundleinfo branch March 14, 2023 04:14
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
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 C-Code-Quality A section of code that is hard to understand or change 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