From abb1b4be378c841a350780752390ee546ea32999 Mon Sep 17 00:00:00 2001 From: TheRawMeatball Date: Thu, 29 Apr 2021 12:51:29 +0300 Subject: [PATCH] Fix unsound for_each_mut --- crates/bevy_ecs/src/system/query.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/system/query.rs b/crates/bevy_ecs/src/system/query.rs index 7158aed39dafe..a2f2e94be9a5a 100644 --- a/crates/bevy_ecs/src/system/query.rs +++ b/crates/bevy_ecs/src/system/query.rs @@ -206,7 +206,7 @@ where /// Runs `f` on each query result. This is faster than the equivalent iter() method, but cannot /// be chained like a normal [`Iterator`]. #[inline] - pub fn for_each_mut(&self, f: impl FnMut(>::Item)) { + pub fn for_each_mut(&mut self, f: impl FnMut(>::Item)) { // SAFE: system runs without conflicts with other systems. same-system queries have runtime // borrow checks when they conflict unsafe {