bevy/crates/bevy_ecs/src
Dawid Piotrowski 0bf7f3153d Allow access to non-send resource through World::resource_scope (#6113)
# Objective

Relaxes the trait bound for `World::resource_scope` to allow non-send resources. Fixes #6037.

## Solution

No big changes in code had to be made. Added a check so that the non-send resources won't be accessed from a different thread.

---

## Changelog
 - `World::resource_scope` accepts non-send resources now
 - `World::resource_scope` verifies non-send access if the resource is non-send
 - Two new tests are added, one for valid use of `World::resource_scope` with a non-send resource, and one for invalid use (calling it from a different thread, resulting in panic)

Co-authored-by: Dawid Piotrowski <41804418+Pietrek14@users.noreply.github.com>
2022-09-28 17:53:58 +00:00
..
entity Exclusive Systems Now Implement System. Flexible Exclusive System Params (#6083) 2022-09-26 23:57:07 +00:00
query Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
schedule Nested spawns on scope (#4466) 2022-09-28 01:59:10 +00:00
storage Remove insert_resource_with_id (#5608) 2022-08-30 20:32:15 +00:00
system Update API docs for Commands::get_or_spawn to inform the user about invalid returned values (#6117) 2022-09-28 14:09:39 +00:00
world Allow access to non-send resource through World::resource_scope (#6113) 2022-09-28 17:53:58 +00:00
archetype.rs Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
bundle.rs Implement Bundle for Component. Use Bundle tuples for insertion (#2975) 2022-09-20 20:17:08 +00:00
change_detection.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
component.rs Fix CI issues arising from use of Rust 1.64 (#6067) 2022-09-22 16:56:43 +00:00
event.rs Optimize use statement (#5992) 2022-09-15 17:05:09 +00:00
lib.rs Allow access to non-send resource through World::resource_scope (#6113) 2022-09-28 17:53:58 +00:00
reflect.rs remove ReflectMut in favor of Mut<dyn Reflect> (#5630) 2022-08-09 16:19:34 +00:00