diff --git a/crates/bevy_transform/src/systems.rs b/crates/bevy_transform/src/systems.rs index f32a19dc42982..6b632932714fc 100644 --- a/crates/bevy_transform/src/systems.rs +++ b/crates/bevy_transform/src/systems.rs @@ -79,7 +79,7 @@ pub fn propagate_transforms( // - Since each root entity is unique and the hierarchy is consistent and forest-like, // other root entities' `propagate_recursive` calls will not conflict with this one. // - Since this is the only place where `transform_query` gets used, there will be no conflicting fetches elsewhere. - #[allow(unsafe_code)] + #[expect(unsafe_code, reason = "`propagate_recursive() is unsafe due to its use of `Query::get_unchecked()`.")] unsafe { propagate_recursive( &global_transform, @@ -107,7 +107,10 @@ pub fn propagate_transforms( /// nor any of its descendants. /// - The caller must ensure that the hierarchy leading to `entity` /// is well-formed and must remain as a tree or a forest. Each entity must have at most one parent. -#[allow(unsafe_code)] +#[expect( + unsafe_code, + reason = "This function uses `Query::get_unchecked()`, which can result in multiple mutable references if the preconditions are not met." +)] unsafe fn propagate_recursive( parent: &GlobalTransform, transform_query: &Query<