bevy_ecs::world::entity_ref::EntityWorldMut::take()
, a safe function, has an undocumented unsafe block
#17345
Labels
A-ECS
Entities, components, systems, and events
C-Code-Quality
A section of code that is hard to understand or change
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
Whilst writing #17335, I came across an undocumented unsafe block:
bevy/crates/bevy_ecs/src/world/entity_ref.rs
Lines 1761 to 1773 in 141b767
A safety comment should be provided. Having looked around, I found a similar call to this function, this time with a safety comment (though in an unsafe function):
bevy/crates/bevy_ecs/src/world/entity_ref.rs
Lines 1931 to 1943 in 141b767
which could possibly be used as a starting point for figuring out what the safety requirements of the called function even are, because the safety documentation for the called function isn't that great:
bevy/crates/bevy_ecs/src/world/entity_ref.rs
Lines 1779 to 1788 in 141b767
Note: While this issue is similar to #11590, I consider it different enough to make a new issue. In particular, that issue is about undocumented unsafe blocks inside unsafe functions - while this is about an undocumented unsafe block inside a safe function.
The text was updated successfully, but these errors were encountered: