Skip to content

Commit a1ef231

Browse files
committed
fix impl
1 parent 1efe8cd commit a1ef231

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

crates/bevy_ecs/src/system/function_system.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,14 @@ impl<Param: SystemParam> SystemState<Param> {
343343
/// Validates that the data can be acquired
344344
/// For systems this means they won't be executed.
345345
///
346-
// SAFETY: Delegated to existing `SystemParam` implementations.
347-
pub unsafe fn validate_param(&mut self, world: &mut World) {
348-
Param::apply(&mut self.param_state, &self.meta, world);
346+
/// # Safety
347+
///
348+
/// - The passed [`UnsafeWorldCell`] must have read access to any world data
349+
/// registered in [`new`](SystemState::new).
350+
/// - `world` must be the same [`World`] that was used to initialize [`state`](SystemState::new).
351+
pub unsafe fn validate_param(&self, world: UnsafeWorldCell) -> bool {
352+
// SAFETY: Delegated to existing `SystemParam` implementations.
353+
Param::validate_param(&self.param_state, &self.meta, world)
349354
}
350355

351356
/// Returns `true` if `world_id` matches the [`World`] that was used to call [`SystemState::new`].

crates/bevy_render/src/extract_param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ where
8282
) -> bool {
8383
let mut valid = true;
8484
// SAFETY: Delegated to existing `SystemParam` implementations.
85-
valid &= unsafe { SystemState::<P>::validate_param(&state.state, system_meta, world) };
85+
valid &= unsafe { SystemState::<P>::validate_param(&state.state, world) };
8686
// SAFETY: Delegated to existing `SystemParam` implementations.
8787
valid &= unsafe {
8888
Res::<MainWorld>::validate_param(&state.main_world_state, system_meta, world)

0 commit comments

Comments
 (0)