Remove flush_and_reserve_invalid_assuming_no_entities#16460
Merged
alice-i-cecile merged 4 commits intobevyengine:mainfrom Dec 3, 2024
Merged
Conversation
Member
|
I feel quite strongly that we should get rid of this. Keeping around unsafe backdoors with no users is just asking for surprising problems. For the migration guide, I mostly want them to tell us why they were using this! |
BenjaminBrienen
approved these changes
Nov 22, 2024
BenjaminBrienen
suggested changes
Nov 22, 2024
Co-authored-by: Benjamin Brienen <[email protected]>
BenjaminBrienen
approved these changes
Nov 22, 2024
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
# Objective `flush_and_reserve_invalid_assuming_no_entities` was made for the old rendering world (which was reset every frame) and is usused since the 0.15 retained rendering world, but wasn't removed yet. It is pub, but is undocumented apart from the safety comment. ## Solution Remove `flush_and_reserve_invalid_assuming_no_entities` and the safety invariants this method required for `EntityMeta`, `EntityLocation`, `TableId` and `TableRow`. This reduces the amount of unsafe code & safety invariants and makes bevyengine#16047 easier. ## Alternatives - Document `flush_and_reserve_invalid_assuming_no_entities` and keep it unchanged - Document `flush_and_reserve_invalid_assuming_no_entities` and change it to be based on `EntityMeta::INVALID` ## Migration Guide - exchange `Entities::flush_and_reserve_invalid_assuming_no_entities` for `reserve` and `flush_as_invalid` and notify us if that's insufficient --------- Co-authored-by: Benjamin Brienen <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
flush_and_reserve_invalid_assuming_no_entitieswas made for the old rendering world (which was reset every frame) and is usused since the 0.15 retained rendering world, but wasn't removed yet. It is pub, but is undocumented apart from the safety comment.Solution
Remove
flush_and_reserve_invalid_assuming_no_entitiesand the safety invariants this method required forEntityMeta,EntityLocation,TableIdandTableRow. This reduces the amount of unsafe code & safety invariants and makes #16047 easier.Alternatives
flush_and_reserve_invalid_assuming_no_entitiesand keep it unchangedflush_and_reserve_invalid_assuming_no_entitiesand change it to be based onEntityMeta::INVALIDMigration Guide
Entities::flush_and_reserve_invalid_assuming_no_entitiesforreserveandflush_as_invalidand notify us if that's insufficient