You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When inserting the resource removed in resource_scope during the callback
use bevy_ecs::prelude::*;structResource{}fnmain(){letmut world = World::new();
world.insert_resource(Resource{});
world.resource_scope(|world,_res:Mut<Resource>| {
world.insert_resource(Resource{});});}
bevy panics with an unhelpful message of
thread 'main' panicked at 'assertion failed: !self.contains_resource::<R>()', /home/jakob/.cargo/registry/src/index.crates.io-e139d0d48fed7772/bevy_ecs-0.7.0/src/world/mod.rs:1072:9
What went wrong
It would be nice to show more information, something like resource repro::Resource was inserted during call to resource_scope, which is not allowed because ....
The text was updated successfully, but these errors were encountered:
# Objective
- Fixesbevyengine#5365
- The `assert!()` when the resource from `World::resource_scope` is inserted into the world is not descriptive.
## Solution
- Add more context to the assert inside of `World::resource_scope` when the `FnOnce` param inserts the resource.
# Objective
- Fixesbevyengine#5365
- The `assert!()` when the resource from `World::resource_scope` is inserted into the world is not descriptive.
## Solution
- Add more context to the assert inside of `World::resource_scope` when the `FnOnce` param inserts the resource.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective
- Fixesbevyengine#5365
- The `assert!()` when the resource from `World::resource_scope` is inserted into the world is not descriptive.
## Solution
- Add more context to the assert inside of `World::resource_scope` when the `FnOnce` param inserts the resource.
Bevy version
bevy
main
What you did
When inserting the resource removed in
resource_scope
during the callbackbevy panics with an unhelpful message of
What went wrong
It would be nice to show more information, something like
resource repro::Resource was inserted during call to resource_scope, which is not allowed because ...
.The text was updated successfully, but these errors were encountered: