Skip to content

Commit

Permalink
Reorder safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Suficio committed Oct 24, 2022
1 parent 2948f3d commit 6cbbb9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/bevy_ecs/src/query/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ impl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F> {
///
/// # Safety
///
/// It is possible to get Bevy to cast `&U` into `&T` by providing the incorrect [`ComponentId`].
/// State must be the same as what is returned by [`WorldQuery::init_state`] with the same [`World`]
/// passed into the function.
///
/// When possible use [`QueryState::new`] or initialize state using [`WorldQuery::init_state`] using
/// the same [`World`] passed into this function.
/// Use [`QueryState::new`] directly when possible.
///
/// It is possible to get Bevy to cast `&U` into `&T` by providing the incorrect [`ComponentId`]
/// when querying references to components.
///
/// ```rust
/// # use bevy_ecs::prelude::*;
Expand Down

0 comments on commit 6cbbb9d

Please sign in to comment.