{"record":{"id":"f9cc9024b4b0c65c","repo":"bevyengine/bevy","slug":"e","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/world/mod.rs","lineNumber":884,"sourceCode":"    /// let e3 = world.spawn(Position { x: 0.0, y: 1.0 }).id();\n    ///\n    /// let ids = EntityHashSet::from_iter([e1, e2, e3]);\n    /// for (_id, mut eref) in world.entity_mut(&ids) {\n    ///     let mut pos = eref.get_mut::<Position>().unwrap();\n    ///     pos.y = 2.0;\n    ///     assert_eq!(pos.y, 2.0);\n    /// }\n    /// ```\n    ///\n    /// [`EntityHashSet`]: crate::entity::EntityHashSet\n    #[inline]\n    #[track_caller]\n    pub fn entity_mut<F: WorldEntityFetch>(&mut self, entities: F) -> F::Mut<'_> {\n        #[inline(never)]\n        #[cold]\n        #[track_caller]\n        fn panic_on_err(e: EntityMutableFetchError) -> ! {\n            panic!(\"{e}\");\n        }\n\n        match self.get_entity_mut(entities) {\n            Ok(fetched) => fetched,\n            Err(e) => panic_on_err(e),\n        }\n    }\n\n    /// Returns the components of an [`Entity`] through [`ComponentInfo`].\n    #[inline]\n    pub fn inspect_entity(\n        &self,\n        entity: Entity,\n    ) -> Result<impl Iterator<Item = &ComponentInfo>, EntityNotSpawnedError> {\n        let entity_location = self.entities().get_spawned(entity)?;\n\n        let archetype = self\n            .archetypes()","sourceCodeStart":866,"sourceCodeEnd":902,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/world/mod.rs#L866-L902","documentation":"Forwarding panic (panic_on_err) in World::entity_mut: mutable entity fetching failed; the underlying error (e.g. EntityMutableFetchError for despawned or doubly-borrowed entities) is rendered into this message.","triggerScenarios":"Thrown at crates/bevy_ecs/src/world/mod.rs:884 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use world.get_entity_mut(...) to handle missing entities as an Option","Avoid requesting the same entity mutably twice in one fetch","Check entity validity after any operation that may despawn entities"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}