bevyengine / bevyengine/bevy

Refactor access patterns of `UnsafeWorldCell`

Open
#12,214 0 comments 2 reactions 0 assignees View on GitHub
A-ECS C-Code-Quality D-Complex
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

> Not super comfortable with this, since the rest of `UnsafeWorldCell`'s method don't use or respect this memory access pattern (`world_mut` is a special case). They just create and encapsulate `&World` references and provide restricted access. It's fine for now though since it's private and unsafe, but I think we should refactor the rest of `UnsafeWorldCell` to use this memory access pattern, and probably remove `world_metadata` since it's possible to access metadata safely through provided methods.

_Originally posted by @JoJoJet in https://github.com/bevyengine/bevy/pull/10756#discussion_r1480976815_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.