mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 14:10:19 +00:00
Mention creation of disjoint Querys with Without<T>
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<T>` was enough to solve the problem. ## Solution Mention the usage of `Without<T>` to create disjoint queries as an alternative to `QuerySet` ## Open Questions - Is `disjoint` a too technical/mathematical word? - Should `Without<T>` be mentioned before or after `QuerySet`? - Before: Using `Without<T>` 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>
This commit is contained in:
parent
46cae5956f
commit
b911a005d9
1 changed files with 1 additions and 1 deletions
|
@ -180,7 +180,7 @@ fn assert_component_access_compatibility(
|
||||||
.map(|component_id| world.components.get_info(component_id).unwrap().name())
|
.map(|component_id| world.components.get_info(component_id).unwrap().name())
|
||||||
.collect::<Vec<&str>>();
|
.collect::<Vec<&str>>();
|
||||||
let accesses = conflicting_components.join(", ");
|
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<T>` to create disjoint Queries or merging conflicting Queries into a `QuerySet`.",
|
||||||
query_type, filter_type, system_name, accesses);
|
query_type, filter_type, system_name, accesses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue