From b911a005d9493cfcead1f9045d9bba3bc509edaf Mon Sep 17 00:00:00 2001 From: MinerSebas Date: Thu, 1 Jul 2021 20:20:11 +0000 Subject: [PATCH] Mention creation of disjoint Querys with `Without` in conflicting access Panic (#2413) # Objective Beginners semi-regularly appear on the Discord asking for help with using `QuerySet` when they have a system with conflicting data access. This happens because the Resulting Panic message only mentions `QuerySet` as a solution, even if in most cases `Without` was enough to solve the problem. ## Solution Mention the usage of `Without` to create disjoint queries as an alternative to `QuerySet` ## Open Questions - Is `disjoint` a too technical/mathematical word? - Should `Without` be mentioned before or after `QuerySet`? - Before: Using `Without` should be preferred and mentioning it first reinforces this for a reader. - After: The Panics can be very long and a Reader could skip to end and only see the `QuerySet` Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com> --- crates/bevy_ecs/src/system/system_param.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index 06e44626ee..632501a569 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -180,7 +180,7 @@ fn assert_component_access_compatibility( .map(|component_id| world.components.get_info(component_id).unwrap().name()) .collect::>(); let accesses = conflicting_components.join(", "); - panic!("Query<{}, {}> in system {} accesses component(s) {} in a way that conflicts with a previous system parameter. Allowing this would break Rust's mutability rules. Consider merging conflicting Queries into a QuerySet.", + panic!("Query<{}, {}> in system {} accesses component(s) {} in a way that conflicts with a previous system parameter. Allowing this would break Rust's mutability rules. Consider using `Without` to create disjoint Queries or merging conflicting Queries into a `QuerySet`.", query_type, filter_type, system_name, accesses); }