This commit is contained in:
MiniaczQ 2024-09-18 22:31:23 +02:00
parent 74210d4f65
commit 03ca7adf87
3 changed files with 12 additions and 10 deletions

View file

@ -614,8 +614,8 @@ unsafe impl<'a, T: Resource> SystemParam for Res<'a, T> {
_system_meta: &SystemMeta,
world: UnsafeWorldCell,
) -> bool {
world
.storages()
// SAFETY: Read-only access to resource metadata.
unsafe { world.storages() }
.resources
.get(component_id)
.map(ResourceData::is_present)
@ -734,8 +734,8 @@ unsafe impl<'a, T: Resource> SystemParam for ResMut<'a, T> {
_system_meta: &SystemMeta,
world: UnsafeWorldCell,
) -> bool {
world
.storages()
// SAFETY: Read-only access to resource metadata.
unsafe { world.storages() }
.resources
.get(component_id)
.map(ResourceData::is_present)
@ -1327,8 +1327,8 @@ unsafe impl<'a, T: 'static> SystemParam for NonSend<'a, T> {
_system_meta: &SystemMeta,
world: UnsafeWorldCell,
) -> bool {
world
.storages()
// SAFETY: Read-only access to resource metadata.
unsafe { world.storages() }
.non_send_resources
.get(component_id)
.map(ResourceData::is_present)
@ -1444,8 +1444,8 @@ unsafe impl<'a, T: 'static> SystemParam for NonSendMut<'a, T> {
_system_meta: &SystemMeta,
world: UnsafeWorldCell,
) -> bool {
world
.storages()
// SAFETY: Read-only access to resource metadata.
unsafe { world.storages() }
.non_send_resources
.get(component_id)
.map(ResourceData::is_present)

View file

@ -193,7 +193,8 @@ where
system_meta: &SystemMeta,
world: UnsafeWorldCell,
) -> bool {
GizmosState::<Config, Clear>::validate_param(&state.state, system_meta, world)
// SAFETY: Delegated to existing `SystemParam` implementations
unsafe { GizmosState::<Config, Clear>::validate_param(&state.state, system_meta, world) }
}
#[inline]

View file

@ -80,7 +80,8 @@ where
system_meta: &SystemMeta,
world: UnsafeWorldCell,
) -> bool {
Res::<MainWorld>::validate_param(&state.main_world_state, system_meta, world)
// SAFETY: Delegated to existing `SystemParam` implementations.
unsafe { Res::<MainWorld>::validate_param(&state.main_world_state, system_meta, world) }
}
#[inline]