diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs index 8bd2fda8843b0..bc37a6b577138 100644 --- a/crates/bevy_ecs/src/world/entity_ref.rs +++ b/crates/bevy_ecs/src/world/entity_ref.rs @@ -1182,6 +1182,7 @@ impl<'w> EntityWorldMut<'w> { /// /// Allows you to clean-up all components associated with the entity without removing it from the world. pub fn clear(&mut self) { + // We must collect here to appease the borrow checker let components: Vec = self.archetype().components().collect(); for component_id in components { self.remove_by_id(component_id);