-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Nondescriptive panic message during resource_scope #5365
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy
Description
Bevy version
bevy main
What you did
When inserting the resource removed in resource_scope during the callback
use bevy_ecs::prelude::*;
struct Resource {}
fn main() {
let mut 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:9What 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 ....
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy