bevy/crates/bevy_ecs/src/entity
Alice Cecile 39e14a4a40 Make EntityRef::new unsafe (#7222)
# Objective

- We rely on the construction of `EntityRef` to be valid elsewhere in unsafe code. This construction is not checked (for performance reasons), and thus this private method must be unsafe.
- Fixes #7218.

## Solution

- Make the method unsafe.
- Add safety docs.
- Improve safety docs slightly for the sibling `EntityMut::new`.
- Add debug asserts to start to verify these assumptions in debug mode.


## Context for reviewers

I attempted to verify the `EntityLocation` more thoroughly, but this turned out to be more work than expected. I've spun that off into #7221 as a result.
2023-01-16 22:10:51 +00:00
..
map_entities.rs Add EntityMap::iter() (#6935) 2022-12-16 20:14:13 +00:00
mod.rs Make EntityRef::new unsafe (#7222) 2023-01-16 22:10:51 +00:00