Skip to content

Commit

Permalink
refactor(transform): migrate bevy_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Sep 13, 2024
1 parent 21a1ac0 commit d9a78b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/bevy_transform/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<
Expand Down

0 comments on commit d9a78b4

Please sign in to comment.