Files
bevy/errors
Trashtalk217 c89541a1af Remove resources from Access (#22910)
# Objective

There's a lot of code duplication in `access.rs`. The same logic is
duplicated between components and resources. This also takes up
unnecessary memory in `Access`, as it relies on bitsets spanning the
entire `ComponentId` range.

## Solution

Since resources are now a special kind of component, this can be
removed.

## Limitations

Since `!Send` data queries used `Access` resources, `!Send` data queries
now conflict with broad queries.
```rust
// 0.18
fn system(q1_: Query<EntityMut>, q2_: NonSend<R>) {} // valid, does not conflict

// 0.19
fn system(q1_: Query<EntityMut>, q2_: NonSend<R>) {} // invalid, does conflict
```
Given how rarely non-send data is used, I recommend using
```
// 0.19
fn system(q1_: Query<EntityMut, Without<R>>, q2_: NonSend<R>) {} // works again
```

If this is also unacceptable, this PR is blocked on the `!Send` data
removal from the ECS (or some hacky workaround).

## Extra Attention

@chescock brought `AssetChanged` to my attention. It has a weird access
pattern. See the following example:
```rust
fn system(c: Query<&mut AssetChanges<Mesh>>, r: Query<(), AssetChanged<Mesh>>) {}
```
System `c` registers access with `add_write` for `AssetChanges<Mesh>`,
while `r` registers access with `add_read` for both `Mesh` and
`AssetChanges<Mesh>`. This system is invalid, and I've added a test to
reflect that. However, since this stuff is tricky, I would like some
extra eyes on it. Currently, it looks *fine*.
2026-03-02 23:48:04 +00:00
..
2026-03-02 23:48:04 +00:00
2026-03-02 23:48:04 +00:00
2024-10-13 17:06:22 +00:00
2025-06-05 23:09:28 +00:00

Bevy Error Codes

This crate lists and tests explanations and examples of Bevy's error codes.

For the latest Bevy release, you can find a rendered version of the error code descriptions at bevy.org/learn/errors.