From cbf39b7eabb29ef003c8b86ff31b286be8bf988c Mon Sep 17 00:00:00 2001 From: Aldrich Suratos Date: Fri, 1 Dec 2023 18:48:16 +0900 Subject: [PATCH] Deprecate QueryState::for_each_unchecked (#10815) # Objective Resolves Issue #10772. ## Solution Added the deprecated warning for QueryState::for_each_unchecked, as noted in the comments of PR #6773. Followed the wording in the deprecation messages for `for_each` and `for_each_mut` --- crates/bevy_ecs/src/query/state.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs index c65ad65ec2706..d27af25a11a7b 100644 --- a/crates/bevy_ecs/src/query/state.rs +++ b/crates/bevy_ecs/src/query/state.rs @@ -1040,6 +1040,10 @@ impl QueryState { /// This does not check for mutable query correctness. To be safe, make sure mutable queries /// have unique access to the components they query. #[inline] + #[deprecated( + since = "0.13.0", + note = "QueryState::for_each_unchecked was not idiomatic Rust and has been moved to query.iter_unchecked_manual().for_each()" + )] pub unsafe fn for_each_unchecked<'w, FN: FnMut(Q::Item<'w>)>( &mut self, world: UnsafeWorldCell<'w>,