diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs index 45dc0f6237ba0a..db05181d53215c 100644 --- a/crates/bevy_ecs/src/query/state.rs +++ b/crates/bevy_ecs/src/query/state.rs @@ -107,10 +107,13 @@ impl QueryState { /// /// # 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::*;