From adb22e386bfd9df7e7fbfd2778d85164b5d994c7 Mon Sep 17 00:00:00 2001 From: Joy <51241057+maniwani@users.noreply.github.com> Date: Sat, 24 Sep 2022 10:26:54 -0700 Subject: [PATCH] remove redundant check --- crates/bevy_ecs/src/system/system_param.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index b2c4be0c1220b..2a7eeed35138c 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -706,27 +706,13 @@ impl<'w> SystemParam for &'w mut World { type Fetch = WorldMutState; } +// SAFETY: `WorldAccessLevel::Exclusive` is set and conflicts result in a panic at construction unsafe impl SystemParamState for WorldMutState { fn init(_world: &mut World, system_meta: &mut SystemMeta) -> Self { + // no need to check for param conflicts, but add access for system conflicts let mut world_access = FilteredAccess::default(); world_access.write_all(); - - // conflict with any preceding param - if !system_meta - .component_access_set - .is_compatible_single(&world_access) - { - panic!( - "&mut World conflicts with another system param in {}. \ - Mutable access must be unique.", - system_meta.name, - ); - } - - // conflict with any following param system_meta.component_access_set.add(world_access); - - // executor system_meta.archetype_component_access.write_all(); // world can contain non-send resources, must run on its local thread