From b3fa3fcb4fddf0f8a88293ad102ebf9cba4d7bed Mon Sep 17 00:00:00 2001 From: Nilirad Date: Sun, 31 Jul 2022 17:39:11 +0200 Subject: [PATCH] Move `WorldQuery safety section up --- crates/bevy_ecs/src/query/fetch.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bevy_ecs/src/query/fetch.rs b/crates/bevy_ecs/src/query/fetch.rs index faf5d8f855a133..81255bd6dbb8c8 100644 --- a/crates/bevy_ecs/src/query/fetch.rs +++ b/crates/bevy_ecs/src/query/fetch.rs @@ -43,6 +43,11 @@ use std::{cell::UnsafeCell, marker::PhantomData}; /// /// Implementing the trait manually can allow for a fundamentally new type of behaviour. /// +/// # Safety +/// +/// component access of `ROQueryFetch` must be a subset of `QueryFetch` +/// and `ROQueryFetch` must match exactly the same archetypes/tables as `QueryFetch` +/// /// # Trait derivation /// /// Query design can be easily structured by deriving `WorldQuery` for custom types. @@ -274,11 +279,6 @@ use std::{cell::UnsafeCell, marker::PhantomData}; /// # bevy_ecs::system::assert_is_system(my_system); /// ``` /// -/// # Safety -/// -/// component access of `ROQueryFetch` must be a subset of `QueryFetch` -/// and `ROQueryFetch` must match exactly the same archetypes/tables as `QueryFetch` -/// /// [`Added`]: crate::query::Added /// [`Changed`]: crate::query::Changed /// [`Or`]: crate::query::Or