bevy/crates/bevy_ecs/src
JoJoJet 4b326fb4ca Improve safety for BlobVec::replace_unchecked (#7181)
# Objective

- The function `BlobVec::replace_unchecked` has informal use of safety comments.
- This function does strange things with `OwningPtr` in order to get around the borrow checker.

## Solution

- Put safety comments in front of each unsafe operation. Describe the specific invariants of each operation and how they apply here.
- Added a guard type `OnDrop`, which is used to simplify ownership transfer in case of a panic.

---

## Changelog

+ Added the guard type `bevy_utils::OnDrop`.
+ Added conversions from `Ptr`, `PtrMut`, and `OwningPtr` to `NonNull<u8>`.
2023-01-16 15:41:12 +00:00
..
entity Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
query Added Ref to allow immutable access with change detection (#7097) 2023-01-11 15:41:54 +00:00
schedule Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
storage Improve safety for BlobVec::replace_unchecked (#7181) 2023-01-16 15:41:12 +00:00
system Support piping exclusive systems (#7023) 2023-01-16 15:22:38 +00:00
world refactor: move internals from entity_ref to World, add SAFETY comments (#6402) 2023-01-13 16:50:26 +00:00
archetype.rs Mark TableRow and TableId as repr(transparent) (#7166) 2023-01-11 23:31:22 +00:00
bundle.rs Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
change_detection.rs Add a method for converting MutUntyped -> Mut<T> (#7113) 2023-01-11 17:47:54 +00:00
component.rs Document options for !Sync types for Component and Resources (#6864) 2022-12-11 18:34:13 +00:00
event.rs Rework manual event iterator so we can actually name the type (#5735) 2022-12-25 00:39:27 +00:00
lib.rs Added Ref to allow immutable access with change detection (#7097) 2023-01-11 15:41:54 +00:00
reflect.rs Enable Constructing ReflectComponent/Resource (#6257) 2022-10-17 14:01:50 +00:00