repo
string | pull_number
int64 | instance_id
string | issue_numbers
list | base_commit
string | patch
string | test_patch
string | problem_statement
string | hints_text
string | created_at
string | version
string | updated_at
string | environment_setup_commit
string | FAIL_TO_PASS
list | PASS_TO_PASS
list | FAIL_TO_FAIL
list | PASS_TO_FAIL
list | source_dir
string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bevyengine/bevy
| 15,166
|
bevyengine__bevy-15166
|
[
"15105",
"15105"
] |
8bfe635c3e119fa9324ba738ac11d30e7b988ac1
|
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -1017,13 +1017,36 @@ impl EntityCommands<'_> {
///
/// # Panics
///
+ /// The command will panic when applied if the associated entity does not exist.
+ ///
+ /// To avoid a panic in this case, use the command [`Self::try_insert_if_new`] instead.
+ pub fn insert_if_new(self, bundle: impl Bundle) -> Self {
+ self.add(insert(bundle, InsertMode::Keep))
+ }
+
+ /// Adds a [`Bundle`] of components to the entity without overwriting if the
+ /// predicate returns true.
+ ///
+ /// This is the same as [`EntityCommands::insert_if`], but in case of duplicate
+ /// components will leave the old values instead of replacing them with new
+ /// ones.
+ ///
+ /// # Panics
+ ///
/// The command will panic when applied if the associated entity does not
/// exist.
///
/// To avoid a panic in this case, use the command [`Self::try_insert_if_new`]
/// instead.
- pub fn insert_if_new(self, bundle: impl Bundle) -> Self {
- self.add(insert(bundle, InsertMode::Keep))
+ pub fn insert_if_new_and<F>(self, bundle: impl Bundle, condition: F) -> Self
+ where
+ F: FnOnce() -> bool,
+ {
+ if condition() {
+ self.insert_if_new(bundle)
+ } else {
+ self
+ }
}
/// Adds a dynamic component to an entity.
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -1161,6 +1184,52 @@ impl EntityCommands<'_> {
}
}
+ /// Tries to add a [`Bundle`] of components to the entity without overwriting if the
+ /// predicate returns true.
+ ///
+ /// This is the same as [`EntityCommands::try_insert_if`], but in case of duplicate
+ /// components will leave the old values instead of replacing them with new
+ /// ones.
+ ///
+ /// # Note
+ ///
+ /// Unlike [`Self::insert_if_new_and`], this will not panic if the associated entity does
+ /// not exist.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # use bevy_ecs::prelude::*;
+ /// # #[derive(Resource)]
+ /// # struct PlayerEntity { entity: Entity }
+ /// # impl PlayerEntity { fn is_spectator(&self) -> bool { true } }
+ /// #[derive(Component)]
+ /// struct StillLoadingStats;
+ /// #[derive(Component)]
+ /// struct Health(u32);
+ ///
+ /// fn add_health_system(mut commands: Commands, player: Res<PlayerEntity>) {
+ /// commands.entity(player.entity)
+ /// .try_insert_if(Health(10), || player.is_spectator())
+ /// .remove::<StillLoadingStats>();
+ ///
+ /// commands.entity(player.entity)
+ /// // This will not panic nor will it overwrite the component
+ /// .try_insert_if_new_and(Health(5), || player.is_spectator());
+ /// }
+ /// # bevy_ecs::system::assert_is_system(add_health_system);
+ /// ```
+ pub fn try_insert_if_new_and<F>(self, bundle: impl Bundle, condition: F) -> Self
+ where
+ F: FnOnce() -> bool,
+ {
+ if condition() {
+ self.try_insert_if_new(bundle)
+ } else {
+ self
+ }
+ }
+
/// Tries to add a [`Bundle`] of components to the entity without overwriting.
///
/// This is the same as [`EntityCommands::try_insert`], but in case of duplicate
|
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -1684,6 +1753,45 @@ mod tests {
assert_eq!(results3, vec![(42u32, 0u64), (0u32, 42u64)]);
}
+ #[test]
+ fn insert_components() {
+ let mut world = World::default();
+ let mut command_queue1 = CommandQueue::default();
+
+ // insert components
+ let entity = Commands::new(&mut command_queue1, &world)
+ .spawn(())
+ .insert_if(W(1u8), || true)
+ .insert_if(W(2u8), || false)
+ .insert_if_new(W(1u16))
+ .insert_if_new(W(2u16))
+ .insert_if_new_and(W(1u32), || false)
+ .insert_if_new_and(W(2u32), || true)
+ .insert_if_new_and(W(3u32), || true)
+ .id();
+ command_queue1.apply(&mut world);
+
+ let results = world
+ .query::<(&W<u8>, &W<u16>, &W<u32>)>()
+ .iter(&world)
+ .map(|(a, b, c)| (a.0, b.0, c.0))
+ .collect::<Vec<_>>();
+ assert_eq!(results, vec![(1u8, 1u16, 2u32)]);
+
+ // try to insert components after despawning entity
+ // in another command queue
+ Commands::new(&mut command_queue1, &world)
+ .entity(entity)
+ .try_insert_if_new_and(W(1u64), || true);
+
+ let mut command_queue2 = CommandQueue::default();
+ Commands::new(&mut command_queue2, &world)
+ .entity(entity)
+ .despawn();
+ command_queue2.apply(&mut world);
+ command_queue1.apply(&mut world);
+ }
+
#[test]
fn remove_components() {
let mut world = World::default();
|
Add missing insert APIs for predicates
## What problem does this solve or what need does it fill?
For consistency, we are missing the following methods:
- `insert_if_new_and` (`insert_if_new` + `insert_if`)
- `try_insert_if_new_and` (`try_insert` +`insert_if_new` + `insert_if`)
## Additional context
https://github.com/bevyengine/bevy/pull/14897 added the predicate methods, and we decided to leave these out for some naming bikeshed. This bikeshed happened on [Discord](https://discord.com/channels/691052431525675048/749335865876021248/1282499667619217529). This is a rather uncontroversial result that does not require any big changes.
Add missing insert APIs for predicates
## What problem does this solve or what need does it fill?
For consistency, we are missing the following methods:
- `insert_if_new_and` (`insert_if_new` + `insert_if`)
- `try_insert_if_new_and` (`try_insert` +`insert_if_new` + `insert_if`)
## Additional context
https://github.com/bevyengine/bevy/pull/14897 added the predicate methods, and we decided to leave these out for some naming bikeshed. This bikeshed happened on [Discord](https://discord.com/channels/691052431525675048/749335865876021248/1282499667619217529). This is a rather uncontroversial result that does not require any big changes.
|
2024-09-11T20:27:48Z
|
1.79
|
2024-09-16T23:16:19Z
|
612897becd415b7b982f58bd76deb719b42c9790
|
[
"change_detection::tests::as_deref_mut",
"change_detection::tests::mut_from_non_send_mut",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"bundle::tests::component_hook_order_spawn_despawn",
"bundle::tests::component_hook_order_replace",
"bundle::tests::component_hook_order_insert_remove",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::mut_new",
"bundle::tests::insert_if_new",
"change_detection::tests::map_mut",
"bundle::tests::component_hook_order_recursive",
"bundle::tests::component_hook_order_recursive_multiple",
"change_detection::tests::change_tick_scan",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::change_expiration",
"entity::map_entities::tests::dyn_entity_mapper_object_safe",
"change_detection::tests::set_if_neq",
"entity::map_entities::tests::entity_mapper",
"entity::tests::entity_bits_roundtrip",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::map_entities::tests::entity_mapper_iteration",
"entity::tests::entity_const",
"entity::tests::entity_comparison",
"entity::tests::entity_debug",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_cursor_clear",
"event::tests::test_event_cursor_iter_len_updated",
"event::tests::test_event_cursor_len_current",
"event::tests::test_event_cursor_len_empty",
"event::tests::test_event_cursor_len_filled",
"event::tests::test_event_cursor_len_update",
"event::tests::test_event_cursor_read",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_event_reader_iter_last",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_events_send_default",
"event::tests::test_events_update_drain",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::from_bits",
"identifier::tests::id_comparison",
"identifier::tests::id_construction",
"intern::tests::different_interned_content",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"intern::tests::zero_sized_type",
"label::tests::dyn_eq_object_safe",
"label::tests::dyn_hash_object_safe",
"observer::tests::observer_despawn",
"observer::tests::observer_dynamic_trigger",
"observer::tests::observer_multiple_events",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_combined_access",
"observer::tests::observer_dynamic_component",
"query::access::tests::filtered_access_extend",
"observer::tests::observer_despawn_archetype_flags",
"query::access::tests::test_access_filters_clone_from",
"query::access::tests::test_access_clone",
"observer::tests::observer_no_target",
"query::access::tests::access_get_conflicts",
"observer::tests::observer_multiple_components",
"query::access::tests::test_access_filters_clone",
"query::access::tests::test_access_clone_from",
"query::access::tests::read_all_access_conflicts",
"observer::tests::observer_order_replace",
"observer::tests::observer_multiple_listeners",
"query::access::tests::test_filtered_access_clone",
"observer::tests::observer_entity_routing",
"observer::tests::observer_propagating_world",
"observer::tests::observer_multiple_matches",
"observer::tests::observer_propagating",
"observer::tests::observer_propagating_no_next",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"observer::tests::observer_propagating_halt",
"query::access::tests::test_filtered_access_set_clone",
"query::access::tests::test_filtered_access_clone_from",
"observer::tests::observer_propagating_join",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"query::access::tests::test_filtered_access_set_from",
"observer::tests::observer_order_spawn_despawn",
"observer::tests::observer_order_insert_remove_sparse",
"observer::tests::observer_order_insert_remove",
"observer::tests::observer_order_recursive",
"query::fetch::tests::world_query_metadata_collision",
"query::builder::tests::builder_static_components",
"query::builder::tests::builder_dynamic_components",
"observer::tests::observer_propagating_world_skipping",
"query::builder::tests::builder_with_without_dynamic",
"query::builder::tests::builder_with_without_static",
"query::builder::tests::builder_static_dense_dynamic_sparse",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_struct_variants",
"query::builder::tests::builder_transmute",
"query::fetch::tests::world_query_phantom_data",
"observer::tests::observer_propagating_parallel_propagation",
"query::builder::tests::builder_or",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::iter::tests::query_sorts",
"query::state::tests::can_transmute_added",
"query::state::tests::can_generalize_with_option",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::can_transmute_entity_mut",
"query::iter::tests::query_sort_after_next - should panic",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::transmute_from_dense_to_sparse",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::tests::any_query",
"query::state::tests::join_with_get",
"query::tests::has_query",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::tests::query",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::transmute_with_different_world - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::tests::self_conflicting_worldquery - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::transmute_from_sparse_to_dense",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::tests::query_iter_combinations_sparse",
"reflect::entity_commands::tests::remove_reflected_bundle_with_registry",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::query_iter_combinations",
"query::tests::multi_storage_query",
"query::state::tests::join",
"reflect::entity_commands::tests::insert_reflect_bundle",
"schedule::condition::tests::distributive_run_if_compiles",
"reflect::entity_commands::tests::insert_reflect_bundle_with_registry",
"reflect::entity_commands::tests::remove_reflected_bundle",
"query::tests::many_entities",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"query::tests::query_filtered_iter_combinations",
"query::tests::derived_worldqueries",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::set::tests::test_derive_schedule_label",
"schedule::set::tests::test_derive_system_set",
"schedule::stepping::tests::clear_breakpoint",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::stepping::tests::continue_never_run",
"event::tests::test_event_mutator_iter_nth",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"schedule::stepping::tests::clear_system",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"schedule::stepping::tests::disabled_never_run",
"event::tests::test_event_reader_iter_nth",
"schedule::schedule::tests::inserts_a_sync_point",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"schedule::schedule::tests::configure_set_on_new_schedule",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::continue_breakpoint",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::set::tests::test_schedule_label",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::condition::tests::multiple_run_conditions",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::step_run_if_false",
"schedule::stepping::tests::waiting_always_run",
"schedule::condition::tests::run_condition_combinators",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::stepping::tests::remove_schedule",
"schedule::tests::stepping::multi_threaded_executor",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::stepping::tests::disabled_always_run",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::schedule::tests::no_sync_chain::chain_second",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::tests::stepping::single_threaded_executor",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"schedule::tests::stepping::simple_executor",
"schedule::condition::tests::run_condition",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::stepping::tests::step_breakpoint",
"schedule::schedule::tests::no_sync_chain::chain_first",
"schedule::stepping::tests::step_always_run",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::stepping::tests::stepping_disabled",
"schedule::schedule::tests::no_sync_chain::chain_all",
"schedule::schedule::tests::merges_sync_points_into_one",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::tests::conditions::system_with_condition",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::tests::system_ambiguity::nonsend",
"schedule::stepping::tests::step_never_run",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::read_component_and_entity_mut",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::system_ambiguity::resource_and_entity_mut",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"schedule::stepping::tests::unknown_schedule",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::system_ambiguity::shared_resource_mut_component",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::system_ambiguity::events",
"storage::sparse_set::tests::sparse_set",
"storage::blob_vec::tests::blob_vec",
"storage::sparse_set::tests::sparse_sets",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::resource_mut_and_entity_ref",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_execution::run_system",
"system::builder::tests::custom_param_builder",
"system::builder::tests::dyn_builder",
"schedule::tests::system_ambiguity::read_world",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::correct_ambiguities",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"storage::blob_vec::tests::resize_test",
"schedule::tests::system_execution::run_exclusive_system",
"storage::table::tests::table",
"system::builder::tests::local_builder",
"system::commands::tests::append",
"event::tests::test_event_cursor_par_read_mut",
"system::builder::tests::multi_param_builder",
"system::builder::tests::multi_param_builder_inference",
"system::builder::tests::query_builder",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::commands::tests::commands",
"system::builder::tests::vec_builder",
"system::function_system::tests::into_system_type_id_consistency",
"system::builder::tests::param_set_vec_builder",
"system::builder::tests::param_set_builder",
"system::commands::tests::remove_components",
"query::tests::par_iter_mut_change_detection",
"system::builder::tests::query_builder_state",
"system::system::tests::command_processing",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"system::commands::tests::test_commands_are_send_and_sync",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::commands::tests::remove_resources",
"event::tests::test_event_cursor_par_read",
"system::system::tests::run_two_systems",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::tests::system_ambiguity::write_component_and_entity_ref",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"system::system::tests::non_send_resources",
"system::system_name::tests::test_closure_system_name_regular_param",
"system::system_name::tests::test_system_name_exclusive_param",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"system::system::tests::run_system_once",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"system::system_param::tests::system_param_const_generics",
"system::system_name::tests::test_system_name_regular_param",
"system::system_param::tests::system_param_generic_bounds",
"system::system_param::tests::system_param_field_limit",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_flexibility",
"system::commands::tests::remove_components_by_id",
"system::system_param::tests::non_sync_local",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_struct_variants",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::param_set_non_send_second",
"system::system_registry::tests::exclusive_system",
"schedule::tests::system_ambiguity::read_only",
"system::system_registry::tests::change_detection",
"system::system_registry::tests::input_values",
"system::system_registry::tests::local_variables",
"schedule::stepping::tests::verify_cursor",
"system::system_param::tests::param_set_non_send_first",
"system::system_registry::tests::output_values",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::nested_systems_with_inputs",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::any_of_and_without",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::any_of_with_empty_and_mut",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::tests::any_of_with_and_without_common",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::any_of_with_entity_and_mut",
"system::tests::any_of_working",
"system::tests::assert_entity_mut_system_does_conflict - should panic",
"schedule::tests::system_ordering::order_systems",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::assert_systems",
"system::tests::assert_entity_ref_and_entity_mut_system_does_conflict - should panic",
"system::tests::assert_world_and_entity_mut_system_does_conflict - should panic",
"system::tests::any_of_with_ref_and_mut - should panic",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::any_of_with_mut_and_ref - should panic",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::conflicting_system_resources - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::get_system_conflicts",
"system::tests::commands_param_set",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::changed_resource_system",
"system::tests::immutable_mut_test",
"system::tests::long_life_test",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::convert_mut_to_immut",
"system::tests::disjoint_query_mut_system",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::into_iter_impl",
"system::tests::non_send_option_system",
"system::tests::nonconflicting_system_resources",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::non_send_system",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::local_system",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::pipe_change_detection",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_has_filter_with",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::query_validates_world_id - should panic",
"system::tests::query_is_empty",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::simple_system",
"system::tests::read_system_state",
"system::tests::panic_inside_system - should panic",
"system::tests::or_param_set_system",
"system::tests::system_state_change_detection",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_archetype_update",
"system::tests::query_set_system",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::write_system_state",
"system::tests::update_archetype_component_access_works",
"tests::added_queries",
"tests::changed_query",
"system::tests::test_combinator_clone",
"tests::added_tracking",
"tests::add_remove_components",
"tests::bundle_derive",
"tests::clear_entities",
"system::tests::world_collections_system",
"tests::duplicate_components_panic - should panic",
"tests::despawn_mixed_storage",
"tests::dynamic_required_components",
"system::tests::removal_tracking",
"tests::despawn_table_storage",
"tests::entity_mut_and_entity_mut_query_panic - should panic",
"tests::empty_spawn",
"tests::entity_ref_and_entity_mut_query_panic - should panic",
"tests::entity_ref_and_entity_ref_query_no_panic",
"tests::changed_trackers_sparse",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::filtered_query_access",
"tests::changed_trackers",
"tests::exact_size_query",
"tests::generic_required_components",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop",
"tests::insert_or_spawn_batch_invalid",
"tests::insert_overwrite_drop_sparse",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::non_send_resource",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::non_send_resource_points_to_distinct_data",
"tests::query_all",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::non_send_resource_panic - should panic",
"tests::query_all_for_each",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::par_for_each_dense",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_with_sparse_for_each",
"tests::par_for_each_sparse",
"tests::query_filter_with_sparse",
"tests::query_filter_without",
"tests::query_missing_component",
"tests::query_get",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_sparse_no_match",
"tests::query_optional_component_table",
"tests::query_optional_component_sparse",
"tests::query_single_component",
"tests::query_single_component_for_each",
"tests::ref_and_mut_query_panic - should panic",
"tests::query_sparse_component",
"tests::random_access",
"tests::remove_missing",
"tests::remove",
"tests::required_components_insert_existing_hooks",
"tests::required_components",
"tests::remove_tracking",
"tests::required_components_spawn_nonexistent_hooks",
"tests::required_components_retain_keeps_required",
"tests::required_components_spawn_then_insert_no_overwrite",
"tests::reserve_and_spawn",
"tests::resource",
"tests::required_components_take_leaves_required",
"tests::resource_scope",
"tests::reserve_entities_across_worlds",
"tests::sparse_set_add_remove_many",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_is_send",
"tests::spawn_batch",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner",
"query::tests::query_filtered_exactsizeiterator_len",
"world::command_queue::test::test_command_queue_inner_drop",
"tests::take",
"tests::test_is_archetypal_size_hints",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::get_components",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_exclusive_system_param",
"world::identifier::tests::world_id_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_by_id",
"world::tests::get_resource_mut_by_id",
"world::tests::init_resource_does_not_overwrite",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::iter_resources",
"world::reflect::tests::get_component_as_mut_reflect",
"world::tests::iter_resources_mut",
"world::reflect::tests::get_component_as_reflect",
"world::tests::spawn_empty_bundle",
"world::tests::iterate_entities_mut",
"world::tests::inspect_entity_components",
"world::tests::test_verify_unique_entities",
"world::tests::panic_while_overwriting_component",
"world::tests::iterate_entities",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1015) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1023) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 305) - compile fail",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 1237) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 239) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 249) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 43)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 91)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 100)",
"crates/bevy_ecs/src/component.rs - component::Component (line 245)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 106) - compile fail",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 60)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 38)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 355)",
"crates/bevy_ecs/src/component.rs - component::Component (line 315)",
"crates/bevy_ecs/src/lib.rs - (line 238)",
"crates/bevy_ecs/src/component.rs - component::Component (line 280)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper::mappings (line 88)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 709)",
"crates/bevy_ecs/src/lib.rs - (line 213)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 36)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/component.rs - component::Component (line 89)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 574)",
"crates/bevy_ecs/src/lib.rs - (line 286)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/observer/mod.rs - observer::Trigger<'w,E,B>::observer (line 69)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/lib.rs - (line 190)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1253)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 222)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 197)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 122)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 787)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1513)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1499)",
"crates/bevy_ecs/src/lib.rs - (line 166)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining (line 63)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 214) - compile fail",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining_mut (line 100)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 266) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 184) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 412) - compile fail",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 379) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 236) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 431) - compile fail",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 36)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 125)",
"crates/bevy_ecs/src/label.rs - label::define_label (line 65)",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 27)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 691)",
"crates/bevy_ecs/src/component.rs - component::Component (line 127)",
"crates/bevy_ecs/src/component.rs - component::Component (line 149)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 89)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 209)",
"crates/bevy_ecs/src/component.rs - component::Component (line 171)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 1009)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 152)",
"crates/bevy_ecs/src/component.rs - component::Component (line 107)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 209)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 103)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 142)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 252)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1721)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 117)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 201)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 118)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 172)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 804)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 105)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 947)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 971)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 158)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 654)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 229)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 344)",
"crates/bevy_ecs/src/lib.rs - (line 335)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 221)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 65)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 598)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 812)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 140)",
"crates/bevy_ecs/src/lib.rs - (line 310)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 246)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 10)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 190)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 62)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 128)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1698)",
"crates/bevy_ecs/src/component.rs - component::Component (line 197)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 295) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 213)",
"crates/bevy_ecs/src/lib.rs - (line 125)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 817)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/lib.rs - (line 253)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 392)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 745)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 133)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 123)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 335)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 812)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 556)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 152)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 648)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 101)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 288)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 993)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 82)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed_to (line 1130)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 949)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1040)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 715)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 830)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1393)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed (line 1081)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 911) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 518)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1022) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 556)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 769)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 665)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 265)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 545)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::reborrow (line 416)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 394)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 897)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 278)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 622)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 378)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 431)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 584)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 620)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert_if (line 982)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 233)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 529) - compile fail",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 262)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 320)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 255)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 927)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 230)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemParamBuilder (line 18)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 507)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 173)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 44)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 144)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 473)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 18)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 733)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 46)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_system (line 678)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 540)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1733)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 891)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 244)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 565)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 592)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 712)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 140)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 843)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 68)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1757) - compile fail",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1527)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1249)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1131)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 182)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 447)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 812)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1570)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 589)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 195)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1284)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 129) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 964)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 806)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 643)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1103)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 485)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 50)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 240)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 260)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1415)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 227)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1208)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1178)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 348)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 412)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::DynSystemParam (line 1865)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 131)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 824)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 377)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 27)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 202)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 273)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 847)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 445)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 80)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1421)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 373)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 339)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1618)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1161)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 833)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1845)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1588)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1673)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 802)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 2263)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 539)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 273)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 955)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 574)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 696)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 744)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 466)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1733)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 455)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1327)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 185)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 313)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 421)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2508)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 609)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1647)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1790)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2486)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1108)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 500)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1076)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 2585)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1562)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1706)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 226)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 412)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1797)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 924)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 891)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1766)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1813)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1055)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1870)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1474)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1023)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1227)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1191)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 31)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1962)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1258)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2848)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 14,631
|
bevyengine__bevy-14631
|
[
"14629"
] |
fc2f564c6f205163b8ba0f3a0bd40fe20739fa7a
|
diff --git a/crates/bevy_ecs/src/observer/runner.rs b/crates/bevy_ecs/src/observer/runner.rs
--- a/crates/bevy_ecs/src/observer/runner.rs
+++ b/crates/bevy_ecs/src/observer/runner.rs
@@ -375,8 +375,7 @@ fn observer_system_runner<E: Event, B: Bundle>(
};
// TODO: Move this check into the observer cache to avoid dynamic dispatch
- // SAFETY: We only access world metadata
- let last_trigger = unsafe { world.world_metadata() }.last_trigger_id();
+ let last_trigger = world.last_trigger_id();
if state.last_trigger_id == last_trigger {
return;
}
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -362,9 +362,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -456,9 +454,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -558,9 +554,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -626,9 +620,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -757,9 +749,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -828,9 +818,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs
--- a/crates/bevy_ecs/src/query/iter.rs
+++ b/crates/bevy_ecs/src/query/iter.rs
@@ -900,9 +888,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
let world = self.world;
- let query_lens_state = self
- .query_state
- .transmute_filtered::<(L, Entity), F>(world.components());
+ let query_lens_state = self.query_state.transmute_filtered::<(L, Entity), F>(world);
// SAFETY:
// `self.world` has permission to access the required components.
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1,7 +1,7 @@
use crate::{
archetype::{Archetype, ArchetypeComponentId, ArchetypeGeneration, ArchetypeId},
batching::BatchingStrategy,
- component::{ComponentId, Components, Tick},
+ component::{ComponentId, Tick},
entity::Entity,
prelude::FromWorld,
query::{
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -476,21 +476,27 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
/// You might end up with a mix of archetypes that only matched the original query + archetypes that only match
/// the new [`QueryState`]. Most of the safe methods on [`QueryState`] call [`QueryState::update_archetypes`] internally, so this
/// best used through a [`Query`](crate::system::Query).
- pub fn transmute<NewD: QueryData>(&self, components: &Components) -> QueryState<NewD> {
- self.transmute_filtered::<NewD, ()>(components)
+ pub fn transmute<'a, NewD: QueryData>(
+ &self,
+ world: impl Into<UnsafeWorldCell<'a>>,
+ ) -> QueryState<NewD> {
+ self.transmute_filtered::<NewD, ()>(world.into())
}
/// Creates a new [`QueryState`] with the same underlying [`FilteredAccess`], matched tables and archetypes
/// as self but with a new type signature.
///
/// Panics if `NewD` or `NewF` require accesses that this query does not have.
- pub fn transmute_filtered<NewD: QueryData, NewF: QueryFilter>(
+ pub fn transmute_filtered<'a, NewD: QueryData, NewF: QueryFilter>(
&self,
- components: &Components,
+ world: impl Into<UnsafeWorldCell<'a>>,
) -> QueryState<NewD, NewF> {
+ let world = world.into();
+ self.validate_world(world.id());
+
let mut component_access = FilteredAccess::default();
- let mut fetch_state = NewD::get_state(components).expect("Could not create fetch_state, Please initialize all referenced components before transmuting.");
- let filter_state = NewF::get_state(components).expect("Could not create filter_state, Please initialize all referenced components before transmuting.");
+ let mut fetch_state = NewD::get_state(world.components()).expect("Could not create fetch_state, Please initialize all referenced components before transmuting.");
+ let filter_state = NewF::get_state(world.components()).expect("Could not create filter_state, Please initialize all referenced components before transmuting.");
NewD::set_access(&mut fetch_state, &self.component_access);
NewD::update_component_access(&fetch_state, &mut component_access);
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -542,12 +548,12 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
/// ## Panics
///
/// Will panic if `NewD` contains accesses not in `Q` or `OtherQ`.
- pub fn join<OtherD: QueryData, NewD: QueryData>(
+ pub fn join<'a, OtherD: QueryData, NewD: QueryData>(
&self,
- components: &Components,
+ world: impl Into<UnsafeWorldCell<'a>>,
other: &QueryState<OtherD>,
) -> QueryState<NewD, ()> {
- self.join_filtered::<_, (), NewD, ()>(components, other)
+ self.join_filtered::<_, (), NewD, ()>(world, other)
}
/// Use this to combine two queries. The data accessed will be the intersection
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -557,23 +563,28 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
///
/// Will panic if `NewD` or `NewF` requires accesses not in `Q` or `OtherQ`.
pub fn join_filtered<
+ 'a,
OtherD: QueryData,
OtherF: QueryFilter,
NewD: QueryData,
NewF: QueryFilter,
>(
&self,
- components: &Components,
+ world: impl Into<UnsafeWorldCell<'a>>,
other: &QueryState<OtherD, OtherF>,
) -> QueryState<NewD, NewF> {
if self.world_id != other.world_id {
panic!("Joining queries initialized on different worlds is not allowed.");
}
+ let world = world.into();
+
+ self.validate_world(world.id());
+
let mut component_access = FilteredAccess::default();
- let mut new_fetch_state = NewD::get_state(components)
+ let mut new_fetch_state = NewD::get_state(world.components())
.expect("Could not create fetch_state, Please initialize all referenced components before transmuting.");
- let new_filter_state = NewF::get_state(components)
+ let new_filter_state = NewF::get_state(world.components())
.expect("Could not create filter_state, Please initialize all referenced components before transmuting.");
NewD::set_access(&mut new_fetch_state, &self.component_access);
diff --git a/crates/bevy_ecs/src/system/query.rs b/crates/bevy_ecs/src/system/query.rs
--- a/crates/bevy_ecs/src/system/query.rs
+++ b/crates/bevy_ecs/src/system/query.rs
@@ -1368,8 +1368,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
pub fn transmute_lens_filtered<NewD: QueryData, NewF: QueryFilter>(
&mut self,
) -> QueryLens<'_, NewD, NewF> {
- let components = self.world.components();
- let state = self.state.transmute_filtered::<NewD, NewF>(components);
+ let state = self.state.transmute_filtered::<NewD, NewF>(self.world);
QueryLens {
world: self.world,
state,
diff --git a/crates/bevy_ecs/src/system/query.rs b/crates/bevy_ecs/src/system/query.rs
--- a/crates/bevy_ecs/src/system/query.rs
+++ b/crates/bevy_ecs/src/system/query.rs
@@ -1460,10 +1459,9 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
&mut self,
other: &mut Query<OtherD, OtherF>,
) -> QueryLens<'_, NewD, NewF> {
- let components = self.world.components();
let state = self
.state
- .join_filtered::<OtherD, OtherF, NewD, NewF>(components, other.state);
+ .join_filtered::<OtherD, OtherF, NewD, NewF>(self.world, other.state);
QueryLens {
world: self.world,
state,
diff --git a/crates/bevy_ecs/src/world/unsafe_world_cell.rs b/crates/bevy_ecs/src/world/unsafe_world_cell.rs
--- a/crates/bevy_ecs/src/world/unsafe_world_cell.rs
+++ b/crates/bevy_ecs/src/world/unsafe_world_cell.rs
@@ -83,6 +83,18 @@ unsafe impl Send for UnsafeWorldCell<'_> {}
// SAFETY: `&World` and `&mut World` are both `Sync`
unsafe impl Sync for UnsafeWorldCell<'_> {}
+impl<'w> From<&'w mut World> for UnsafeWorldCell<'w> {
+ fn from(value: &'w mut World) -> Self {
+ value.as_unsafe_world_cell()
+ }
+}
+
+impl<'w> From<&'w World> for UnsafeWorldCell<'w> {
+ fn from(value: &'w World) -> Self {
+ value.as_unsafe_world_cell_readonly()
+ }
+}
+
impl<'w> UnsafeWorldCell<'w> {
/// Creates a [`UnsafeWorldCell`] that can be used to access everything immutably
#[inline]
diff --git a/crates/bevy_ecs/src/world/unsafe_world_cell.rs b/crates/bevy_ecs/src/world/unsafe_world_cell.rs
--- a/crates/bevy_ecs/src/world/unsafe_world_cell.rs
+++ b/crates/bevy_ecs/src/world/unsafe_world_cell.rs
@@ -257,6 +269,15 @@ impl<'w> UnsafeWorldCell<'w> {
unsafe { self.world_metadata() }.read_change_tick()
}
+ /// Returns the id of the last ECS event that was fired.
+ /// Used internally to ensure observers don't trigger multiple times for the same event.
+ #[inline]
+ pub fn last_trigger_id(&self) -> u32 {
+ // SAFETY:
+ // - we only access world metadata
+ unsafe { self.world_metadata() }.last_trigger_id()
+ }
+
/// Returns the [`Tick`] indicating the last time that [`World::clear_trackers`] was called.
///
/// If this `UnsafeWorldCell` was created from inside of an exclusive system (a [`System`] that
|
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1779,7 +1790,7 @@ mod tests {
world.spawn((A(1), B(0)));
let query_state = world.query::<(&A, &B)>();
- let mut new_query_state = query_state.transmute::<&A>(world.components());
+ let mut new_query_state = query_state.transmute::<&A>(&world);
assert_eq!(new_query_state.iter(&world).len(), 1);
let a = new_query_state.single(&world);
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1793,7 +1804,7 @@ mod tests {
world.spawn((A(1), B(0), C(0)));
let query_state = world.query_filtered::<(&A, &B), Without<C>>();
- let mut new_query_state = query_state.transmute::<&A>(world.components());
+ let mut new_query_state = query_state.transmute::<&A>(&world);
// even though we change the query to not have Without<C>, we do not get the component with C.
let a = new_query_state.single(&world);
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1807,7 +1818,7 @@ mod tests {
let entity = world.spawn(A(10)).id();
let q = world.query::<()>();
- let mut q = q.transmute::<Entity>(world.components());
+ let mut q = q.transmute::<Entity>(&world);
assert_eq!(q.single(&world), entity);
}
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1817,11 +1828,11 @@ mod tests {
world.spawn(A(10));
let q = world.query::<&A>();
- let mut new_q = q.transmute::<Ref<A>>(world.components());
+ let mut new_q = q.transmute::<Ref<A>>(&world);
assert!(new_q.single(&world).is_added());
let q = world.query::<Ref<A>>();
- let _ = q.transmute::<&A>(world.components());
+ let _ = q.transmute::<&A>(&world);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1830,8 +1841,8 @@ mod tests {
world.spawn(A(0));
let q = world.query::<&mut A>();
- let _ = q.transmute::<Ref<A>>(world.components());
- let _ = q.transmute::<&A>(world.components());
+ let _ = q.transmute::<Ref<A>>(&world);
+ let _ = q.transmute::<&A>(&world);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1840,7 +1851,7 @@ mod tests {
world.spawn(A(0));
let q: QueryState<EntityMut<'_>> = world.query::<EntityMut>();
- let _ = q.transmute::<EntityRef>(world.components());
+ let _ = q.transmute::<EntityRef>(&world);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1849,8 +1860,8 @@ mod tests {
world.spawn((A(0), B(0)));
let query_state = world.query::<(Option<&A>, &B)>();
- let _ = query_state.transmute::<Option<&A>>(world.components());
- let _ = query_state.transmute::<&B>(world.components());
+ let _ = query_state.transmute::<Option<&A>>(&world);
+ let _ = query_state.transmute::<&B>(&world);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1864,7 +1875,7 @@ mod tests {
world.spawn(A(0));
let query_state = world.query::<&A>();
- let mut _new_query_state = query_state.transmute::<(&A, &B)>(world.components());
+ let mut _new_query_state = query_state.transmute::<(&A, &B)>(&world);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1876,7 +1887,7 @@ mod tests {
world.spawn(A(0));
let query_state = world.query::<&A>();
- let mut _new_query_state = query_state.transmute::<&mut A>(world.components());
+ let mut _new_query_state = query_state.transmute::<&mut A>(&world);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1888,7 +1899,7 @@ mod tests {
world.spawn(C(0));
let query_state = world.query::<Option<&A>>();
- let mut new_query_state = query_state.transmute::<&A>(world.components());
+ let mut new_query_state = query_state.transmute::<&A>(&world);
let x = new_query_state.single(&world);
assert_eq!(x.0, 1234);
}
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1902,15 +1913,15 @@ mod tests {
world.init_component::<A>();
let q = world.query::<EntityRef>();
- let _ = q.transmute::<&A>(world.components());
+ let _ = q.transmute::<&A>(&world);
}
#[test]
fn can_transmute_filtered_entity() {
let mut world = World::new();
let entity = world.spawn((A(0), B(1))).id();
- let query = QueryState::<(Entity, &A, &B)>::new(&mut world)
- .transmute::<FilteredEntityRef>(world.components());
+ let query =
+ QueryState::<(Entity, &A, &B)>::new(&mut world).transmute::<FilteredEntityRef>(&world);
let mut query = query;
// Our result is completely untyped
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1927,7 +1938,7 @@ mod tests {
let entity_a = world.spawn(A(0)).id();
let mut query = QueryState::<(Entity, &A, Has<B>)>::new(&mut world)
- .transmute_filtered::<(Entity, Has<B>), Added<A>>(world.components());
+ .transmute_filtered::<(Entity, Has<B>), Added<A>>(&world);
assert_eq!((entity_a, false), query.single(&world));
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1947,7 +1958,7 @@ mod tests {
let entity_a = world.spawn(A(0)).id();
let mut detection_query = QueryState::<(Entity, &A)>::new(&mut world)
- .transmute_filtered::<Entity, Changed<A>>(world.components());
+ .transmute_filtered::<Entity, Changed<A>>(&world);
let mut change_query = QueryState::<&mut A>::new(&mut world);
assert_eq!(entity_a, detection_query.single(&world));
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1970,7 +1981,20 @@ mod tests {
world.init_component::<A>();
world.init_component::<B>();
let query = QueryState::<&A>::new(&mut world);
- let _new_query = query.transmute_filtered::<Entity, Changed<B>>(world.components());
+ let _new_query = query.transmute_filtered::<Entity, Changed<B>>(&world);
+ }
+
+ // Regression test for #14629
+ #[test]
+ #[should_panic]
+ fn transmute_with_different_world() {
+ let mut world = World::new();
+ world.spawn((A(1), B(2)));
+
+ let mut world2 = World::new();
+ world2.init_component::<B>();
+
+ world.query::<(&A, &B)>().transmute::<&B>(&world2);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1983,8 +2007,7 @@ mod tests {
let query_1 = QueryState::<&A, Without<C>>::new(&mut world);
let query_2 = QueryState::<&B, Without<C>>::new(&mut world);
- let mut new_query: QueryState<Entity, ()> =
- query_1.join_filtered(world.components(), &query_2);
+ let mut new_query: QueryState<Entity, ()> = query_1.join_filtered(&world, &query_2);
assert_eq!(new_query.single(&world), entity_ab);
}
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1999,8 +2022,7 @@ mod tests {
let query_1 = QueryState::<&A>::new(&mut world);
let query_2 = QueryState::<&B, Without<C>>::new(&mut world);
- let mut new_query: QueryState<Entity, ()> =
- query_1.join_filtered(world.components(), &query_2);
+ let mut new_query: QueryState<Entity, ()> = query_1.join_filtered(&world, &query_2);
assert!(new_query.get(&world, entity_ab).is_ok());
// should not be able to get entity with c.
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -2016,7 +2038,7 @@ mod tests {
world.init_component::<C>();
let query_1 = QueryState::<&A>::new(&mut world);
let query_2 = QueryState::<&B>::new(&mut world);
- let _query: QueryState<&C> = query_1.join(world.components(), &query_2);
+ let _query: QueryState<&C> = query_1.join(&world, &query_2);
}
#[test]
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -2030,6 +2052,6 @@ mod tests {
let mut world = World::new();
let query_1 = QueryState::<&A, Without<C>>::new(&mut world);
let query_2 = QueryState::<&B, Without<C>>::new(&mut world);
- let _: QueryState<Entity, Changed<C>> = query_1.join_filtered(world.components(), &query_2);
+ let _: QueryState<Entity, Changed<C>> = query_1.join_filtered(&world, &query_2);
}
}
|
`Query::transmute`/`Query::transmute_filtered` accept any `&Components` parameter and this is unsound
## Bevy version
Both 0.14.1 and c1c003d
## What you did
```rs
#[derive(Component)]
struct A(u32);
#[derive(Component)]
struct B(u32);
let mut world = World::new();
world.spawn((A(1), B(2)));
let mut world2 = World::new();
world2.init_component::<B>();
let mut query = world
.query::<(&A, &B)>()
.transmute::<&B>(world2.components());
let b = query.single(&world);
assert_eq!(b.0, 2);
```
## What went wrong
I expected either the `transmute` to fail due to a `&Components` passed from the wrong `World`, or the assert to pass, since the only `B` created contains a 2.
Instead the assert fails due `b` containing 1, which was the content of the `A` however.
The issue is that the new query state is created using the component ids for `world2`, where `B` has the component id that `A` has in the original world.
Ultimately this allows to transmute a component to another, which is obviously unsound.
|
2024-08-05T13:52:48Z
|
1.79
|
2024-08-06T06:15:03Z
|
612897becd415b7b982f58bd76deb719b42c9790
|
[
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_new",
"change_detection::tests::as_deref_mut",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"change_detection::tests::mut_untyped_from_mut",
"bundle::tests::component_hook_order_spawn_despawn",
"bundle::tests::component_hook_order_replace",
"change_detection::tests::mut_untyped_to_reflect",
"bundle::tests::component_hook_order_insert_remove",
"entity::map_entities::tests::dyn_entity_mapper_object_safe",
"bundle::tests::component_hook_order_recursive",
"change_detection::tests::set_if_neq",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::change_tick_scan",
"bundle::tests::component_hook_order_recursive_multiple",
"change_detection::tests::change_expiration",
"entity::map_entities::tests::entity_mapper",
"entity::tests::entity_bits_roundtrip",
"entity::map_entities::tests::entity_mapper_iteration",
"entity::tests::entity_comparison",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::tests::entity_const",
"entity::tests::entity_debug",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::test_event_cursor_clear",
"event::tests::test_event_cursor_iter_len_updated",
"event::tests::test_event_cursor_len_current",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_cursor_len_empty",
"event::tests::test_event_cursor_len_filled",
"event::tests::test_event_cursor_len_update",
"event::tests::test_event_cursor_read",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_reader_iter_last",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_events_send_default",
"event::tests::test_events_update_drain",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::from_bits",
"identifier::masks::tests::pack_into_u64",
"identifier::tests::id_comparison",
"identifier::tests::id_construction",
"intern::tests::different_interned_content",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"label::tests::dyn_eq_object_safe",
"intern::tests::zero_sized_type",
"label::tests::dyn_hash_object_safe",
"observer::tests::observer_despawn",
"observer::tests::observer_dynamic_trigger",
"observer::tests::observer_dynamic_component",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend",
"query::access::tests::filtered_access_extend_or",
"observer::tests::observer_multiple_listeners",
"query::access::tests::test_access_filters_clone",
"query::access::tests::filtered_combined_access",
"query::access::tests::test_filtered_access_set_clone",
"query::access::tests::test_filtered_access_clone",
"query::access::tests::test_access_filters_clone_from",
"query::access::tests::read_all_access_conflicts",
"query::access::tests::test_filtered_access_set_from",
"query::access::tests::test_filtered_access_clone_from",
"query::access::tests::test_access_clone",
"observer::tests::observer_propagating_no_next",
"observer::tests::observer_multiple_matches",
"query::builder::tests::builder_dynamic_components",
"observer::tests::observer_multiple_components",
"observer::tests::observer_entity_routing",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"observer::tests::observer_no_target",
"observer::tests::observer_propagating_halt",
"observer::tests::observer_propagating_world_skipping",
"observer::tests::observer_propagating_parallel_propagation",
"query::state::tests::can_transmute_added",
"observer::tests::observer_order_replace",
"query::access::tests::test_access_clone_from",
"observer::tests::observer_propagating_world",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"query::builder::tests::builder_transmute",
"query::builder::tests::builder_with_without_dynamic",
"observer::tests::observer_propagating",
"query::builder::tests::builder_or",
"observer::tests::observer_multiple_events",
"observer::tests::observer_propagating_join",
"observer::tests::observer_order_spawn_despawn",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_metadata_collision",
"query::fetch::tests::world_query_phantom_data",
"query::builder::tests::builder_static_components",
"query::fetch::tests::world_query_struct_variants",
"query::state::tests::can_transmute_changed",
"observer::tests::observer_order_insert_remove_sparse",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"query::iter::tests::query_sorts",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::state::tests::can_generalize_with_option",
"observer::tests::observer_order_recursive",
"query::builder::tests::builder_with_without_static",
"observer::tests::observer_order_insert_remove",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_empty_tuple",
"query::iter::tests::query_sort_after_next - should panic",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::can_transmute_to_more_general",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::join_with_get",
"query::state::tests::join",
"query::tests::has_query",
"query::tests::multi_storage_query",
"query::tests::any_query",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::tests::query",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::many_entities",
"query::tests::query_iter_combinations_sparse",
"query::tests::query_iter_combinations",
"schedule::condition::tests::distributive_run_if_compiles",
"query::tests::self_conflicting_worldquery - should panic",
"query::tests::derived_worldqueries",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"query::tests::query_filtered_iter_combinations",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::set::tests::test_derive_system_set",
"schedule::set::tests::test_derive_schedule_label",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::stepping::tests::continue_never_run",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::disabled_never_run",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::stepping::tests::step_always_run",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::waiting_never_run",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::stepping::tests::waiting_always_run",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::stepping::tests::unknown_schedule",
"schedule::tests::stepping::simple_executor",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::stepping::tests::stepping_disabled",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::stepping::tests::step_breakpoint",
"schedule::stepping::tests::step_never_run",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::tests::system_ambiguity::events",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::system_ambiguity::one_of_everything",
"storage::blob_vec::tests::blob_vec",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::stepping::tests::verify_cursor",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::exclusive",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::before_and_after",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::sparse_set::tests::sparse_sets",
"schedule::tests::system_ambiguity::correct_ambiguities",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"storage::sparse_set::tests::sparse_set",
"storage::blob_vec::tests::resize_test",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::read_world",
"system::builder::tests::local_builder",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"system::builder::tests::multi_param_builder",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"storage::table::tests::table",
"system::commands::tests::append",
"system::commands::tests::commands",
"system::commands::tests::remove_resources",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::function_system::tests::into_system_type_id_consistency",
"system::builder::tests::query_builder",
"system::commands::tests::remove_components",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"system::system::tests::command_processing",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"system::commands::tests::remove_components_by_id",
"system::system::tests::non_send_resources",
"system::system::tests::run_system_once",
"schedule::tests::system_ambiguity::read_only",
"system::system::tests::run_two_systems",
"system::system_name::tests::test_closure_system_name_regular_param",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::stepping::tests::step_run_if_false",
"schedule::tests::system_ordering::order_exclusive_systems",
"event::tests::test_event_mutator_iter_nth",
"schedule::tests::stepping::multi_threaded_executor",
"schedule::tests::system_execution::run_exclusive_system",
"system::system_name::tests::test_system_name_exclusive_param",
"system::system_name::tests::test_system_name_regular_param",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"system::system_param::tests::system_param_generic_bounds",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::set::tests::test_schedule_label",
"system::system_param::tests::system_param_flexibility",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_field_limit",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"system::system_param::tests::system_param_struct_variants",
"schedule::schedule::tests::inserts_a_sync_point",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::non_sync_local",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::system_execution::run_system",
"system::system_param::tests::system_param_const_generics",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_name_collision",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"system::system_registry::tests::input_values",
"system::system_registry::tests::local_variables",
"schedule::schedule::tests::configure_set_on_new_schedule",
"system::system_registry::tests::output_values",
"system::system_registry::tests::exclusive_system",
"system::system_registry::tests::change_detection",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"event::tests::test_event_reader_iter_nth",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::condition::tests::multiple_run_conditions",
"system::system_param::tests::param_set_non_send_first",
"system::system_param::tests::system_param_private_fields",
"schedule::tests::conditions::system_with_condition",
"system::system_registry::tests::nested_systems",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"schedule::condition::tests::run_condition",
"system::tests::any_of_and_without",
"system::tests::any_of_with_empty_and_mut",
"system::system_registry::tests::nested_systems_with_inputs",
"system::system_param::tests::param_set_non_send_second",
"system::tests::any_of_with_entity_and_mut",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::any_of_with_mut_and_ref - should panic",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::any_of_with_ref_and_mut - should panic",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::any_of_with_and_without_common",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::tests::assert_systems",
"system::tests::can_have_16_parameters",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::any_of_working",
"system::tests::conflicting_query_immut_system - should panic",
"schedule::tests::system_ordering::order_systems",
"schedule::condition::tests::run_condition_combinators",
"system::tests::conflicting_query_sets_system - should panic",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::commands_param_set",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::get_system_conflicts",
"system::tests::long_life_test",
"schedule::schedule::tests::no_sync_chain::chain_first",
"query::tests::par_iter_mut_change_detection",
"system::tests::immutable_mut_test",
"event::tests::test_event_cursor_par_read_mut",
"system::tests::convert_mut_to_immut",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::disjoint_query_mut_system",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::tests::changed_resource_system",
"schedule::schedule::tests::no_sync_chain::chain_all",
"system::tests::local_system",
"system::tests::non_send_option_system",
"system::tests::into_iter_impl",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::nonconflicting_system_resources",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"event::tests::test_event_cursor_par_read",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::non_send_system",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::pipe_change_detection",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::or_has_filter_with",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::query_is_empty",
"system::tests::query_validates_world_id - should panic",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_param_set_system",
"system::tests::simple_system",
"system::tests::panic_inside_system - should panic",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::read_system_state",
"system::tests::system_state_archetype_update",
"system::tests::system_state_change_detection",
"system::tests::query_set_system",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::system_state_invalid_world - should panic",
"system::tests::write_system_state",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"tests::added_queries",
"system::tests::update_archetype_component_access_works",
"tests::added_tracking",
"tests::changed_query",
"tests::add_remove_components",
"system::tests::removal_tracking",
"system::tests::test_combinator_clone",
"system::tests::world_collections_system",
"tests::clear_entities",
"tests::bundle_derive",
"tests::despawn_mixed_storage",
"tests::duplicate_components_panic - should panic",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::despawn_table_storage",
"tests::empty_spawn",
"tests::changed_trackers",
"tests::changed_trackers_sparse",
"tests::filtered_query_access",
"tests::exact_size_query",
"tests::insert_or_spawn_batch",
"tests::insert_or_spawn_batch_invalid",
"tests::insert_overwrite_drop",
"tests::insert_overwrite_drop_sparse",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource",
"query::tests::query_filtered_exactsizeiterator_len",
"tests::non_send_resource_points_to_distinct_data",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::non_send_resource_panic - should panic",
"tests::query_all",
"tests::query_all_for_each",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::par_for_each_sparse",
"tests::query_filter_with_sparse",
"tests::query_filter_with_sparse_for_each",
"tests::non_send_resource_drop_from_same_thread",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_without",
"tests::query_missing_component",
"tests::query_get",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_sparse",
"tests::query_optional_component_sparse_no_match",
"tests::query_single_component",
"tests::query_optional_component_table",
"tests::query_single_component_for_each",
"tests::query_sparse_component",
"tests::ref_and_mut_query_panic - should panic",
"tests::random_access",
"tests::remove_missing",
"tests::remove",
"tests::reserve_and_spawn",
"tests::remove_tracking",
"tests::resource",
"tests::resource_scope",
"tests::reserve_entities_across_worlds",
"tests::sparse_set_add_remove_many",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_is_send",
"tests::spawn_batch",
"tests::take",
"world::command_queue::test::test_command_queue_inner",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_exclusive_system_param",
"world::identifier::tests::world_id_system_param",
"world::tests::get_resource_by_id",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iter_resources",
"world::reflect::tests::get_component_as_reflect",
"world::tests::iter_resources_mut",
"world::reflect::tests::get_component_as_mut_reflect",
"world::tests::iterate_entities_mut",
"world::tests::inspect_entity_components",
"world::tests::spawn_empty_bundle",
"world::tests::test_verify_unique_entities",
"world::tests::iterate_entities",
"world::tests::panic_while_overwriting_component",
"schedule::tests::system_execution::parallel_execution",
"system::tests::get_many_is_ordered",
"tests::par_for_each_dense",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1001) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 1072) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 166) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 239) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 106) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1009) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 249) - compile",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/lib.rs - (line 290)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1088)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 38)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 100)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 91)",
"crates/bevy_ecs/src/component.rs - component::Component (line 39)",
"crates/bevy_ecs/src/lib.rs - (line 215)",
"crates/bevy_ecs/src/component.rs - component::Component (line 106)",
"crates/bevy_ecs/src/component.rs - component::Component (line 141)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 60)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 208)",
"crates/bevy_ecs/src/component.rs - component::Component (line 176)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/lib.rs - (line 168)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 695)",
"crates/bevy_ecs/src/lib.rs - (line 242)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper::mappings (line 88)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 222)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 545)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 753)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 122)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 197)",
"crates/bevy_ecs/src/component.rs - component::Component (line 85)",
"crates/bevy_ecs/src/lib.rs - (line 192)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 36)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1403)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 266) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 412) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 214) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 184) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 431) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 379) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 236) - compile fail",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 101)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 31)",
"crates/bevy_ecs/src/label.rs - label::define_label (line 65)",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 27)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 844)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 207)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 89)",
"crates/bevy_ecs/src/lib.rs - (line 257)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 806)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 933)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1672)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 790)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 156)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 9)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 126)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 117)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 62)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 123)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 188)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 103)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/lib.rs - (line 316)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 244)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 221)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 65)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 138)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 219)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 333)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 677)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 207)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 152)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 778)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 640)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 133)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 252)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 295) - compile fail",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 245)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1649)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 101)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 180)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 584)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 113)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 170)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 152)",
"crates/bevy_ecs/src/lib.rs - (line 341)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 142)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 665)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 288)",
"crates/bevy_ecs/src/lib.rs - (line 127)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 569)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 335)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 103)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 993)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 265)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 82)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 769)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 228)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 209)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 890) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1001) - compile",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 253)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 526)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 488)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 545)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1040)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 507)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 949)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 462) - compile fail",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 830)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemBuilder (line 12)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 715)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1575) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 729)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 622)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 242)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1551)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 473)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 282)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 44)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 588)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 561)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 249)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::add (line 1138)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_one_shot_system (line 674)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 427)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 616)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::retain (line 1161)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 897)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::remove (line 1054)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 374)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 128)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 233)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 469)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 646)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::despawn (line 1114)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 44)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 822)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 907)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 161)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 943)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 69)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 182)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 417)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert (line 1007)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 872)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1263)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 314)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 195)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 785)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 262)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 144)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1082)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 793)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1157)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 616)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 321)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1187)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 763)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1110)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 49)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 786)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1228)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 350)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 178)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 455)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 27)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 257)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 433)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 385)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 266)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1306)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 219)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 227)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 195)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 559)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 240)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 260)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1363)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1416)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1636)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1548)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1492)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1663)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1577)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1696)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1056)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 314)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 78)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 413)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 834)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 908)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 467)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 2604)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1603)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 540)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1818)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 610)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 340)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1077)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1259)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1162)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2505)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1743)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1800)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1518)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 892)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 456)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1720)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 422)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 575)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2527)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1192)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 745)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 374)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 803)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1775)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 697)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 2282)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2867)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1981)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 925)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1024)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1109)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1228)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 31)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 14,539
|
bevyengine__bevy-14539
|
[
"12139"
] |
ba09f354745b1c4420e6e316d80ac97c9eb37f56
|
diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs
--- a/crates/bevy_ecs/src/entity/mod.rs
+++ b/crates/bevy_ecs/src/entity/mod.rs
@@ -142,7 +142,7 @@ type IdCursor = isize;
/// [`Query::get`]: crate::system::Query::get
/// [`World`]: crate::world::World
/// [SemVer]: https://semver.org/
-#[derive(Clone, Copy, Debug)]
+#[derive(Clone, Copy)]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
#[cfg_attr(feature = "bevy_reflect", reflect_value(Hash, PartialEq))]
#[cfg_attr(
diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs
--- a/crates/bevy_ecs/src/entity/mod.rs
+++ b/crates/bevy_ecs/src/entity/mod.rs
@@ -390,6 +390,42 @@ impl<'de> Deserialize<'de> for Entity {
}
}
+/// Outputs the full entity identifier, including the index, generation, and the raw bits.
+///
+/// This takes the format: `{index}v{generation}#{bits}`.
+///
+/// # Usage
+///
+/// Prefer to use this format for debugging and logging purposes. Because the output contains
+/// the raw bits, it is easy to check it against serialized scene data.
+///
+/// Example serialized scene data:
+/// ```text
+/// (
+/// ...
+/// entities: {
+/// 4294967297: ( <--- Raw Bits
+/// components: {
+/// ...
+/// ),
+/// ...
+/// )
+/// ```
+impl fmt::Debug for Entity {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(
+ f,
+ "{}v{}#{}",
+ self.index(),
+ self.generation(),
+ self.to_bits()
+ )
+ }
+}
+
+/// Outputs the short entity identifier, including the index and generation.
+///
+/// This takes the format: `{index}v{generation}`.
impl fmt::Display for Entity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}v{}", self.index(), self.generation())
|
diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs
--- a/crates/bevy_ecs/src/entity/mod.rs
+++ b/crates/bevy_ecs/src/entity/mod.rs
@@ -1152,6 +1188,15 @@ mod tests {
}
}
+ #[test]
+ fn entity_debug() {
+ let entity = Entity::from_raw(42);
+ let string = format!("{:?}", entity);
+ assert!(string.contains("42"));
+ assert!(string.contains("v1"));
+ assert!(string.contains(format!("#{}", entity.to_bits()).as_str()));
+ }
+
#[test]
fn entity_display() {
let entity = Entity::from_raw(42);
|
Inconsistency between `Debug` and serialized representation of `Entity`
## Bevy version
0.13
## What went wrong
There is an inconsistency between the `Debug` representation of an `Entity`:
```rust
impl fmt::Debug for Entity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}v{}", self.index(), self.generation())
}
}
```
And its `Serialize` representation:
```rust
impl Serialize for Entity {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_u64(self.to_bits())
}
}
```
This makes it difficult to debug serialized outputs, since the serialized entity IDs cannot be easily mapped to runtime entities via human inspection. Ideally, these representations should be consistent for easier debugging.
## Additional information
I wanted to just open a PR on this, but I think the issue warrants some discussion. Mainly on two points:
- Which representation is "correct"?
- If we swap to #v# format for serialized data, are we ok with invalidating existing scenes?
|
Ah: I know what we should do. The serialized representation should stay the same, optimized for information density. This is just an opaque identifier. However, we should make the debug representation more verbose, and report `index`, `generation` and `raw_bits` separately.
In the future, we will be packing more information into here (e.g. entity disabling) that we want to add to the debug output, but we should avoid adding bloat (or semantic meaning) to the serialized representation. Displaying the raw bits separately gives us the best of both worlds, as users will be able to make this correspondence themselves.
I like that idea.
My only concern there is that the current "#v#" format for `Debug` is very compact. This makes it very useful for log messages, since the user can just do `info!("{entity:?} is a cool entity!")`.
This would output something like:
"2v2 is a cool entity"
I'm concerned if we make the `Debug` more verbose, we'd lose this feature. This would open the door to people using either the entity index/generation or the raw bits in log messages, which would produce highly inconsistent log outputs overall.
> I'm concerned if we make the Debug more verbose, we'd lose this feature. This would open the door to people using either the entity index/generation or the raw bits in log messages, which would produce highly inconsistent log outputs overall.
That seems like a prime case for a `Display` impl then: "pretty, humand-readable output" is what belongs there. `Debug` should be maximally clear and helpful IMO.
Just a random idea I had on this topic:
If we take this approach, we could make the `Debug` impl compact as well. Maybe if we pick a format like: `#v#[raw_bits]`
So then `Display` could look like `12v7`. And `Debug` could look like `12v7[12345678]` or `12v7.12345678`
Alternatively, we could make `Display` use the `12v7.12345678` format, and `Debug` to be even more verbose with field names as needed.
I like `12v7[12345678]` for the display impl, and then a properly verbose Debug impl :)
@alice-i-cecile I want to re-open this issue. I don't think the `fmt::Debug` and `fmt::Display` implementation we proposed in the discussions here actually solves the initial problem. Additionally, it introduces a new issue that I was originally concerned about.
## The Problem
The serialized output of Bevy scenes uses the raw bit representation of entities, i.e. `4294967303`.
Many systems, including internal Bevy code, currently log entities using `fmt::Debug` (i.e. `{:?}`).
This is because previously, `fmt::Debug` has format `#v#`, which was short and concise, _but didn't include the raw bits_.
After this change, the `fmt::Debug` implementation is now derived. This means now any log that uses `{:?}` now displays:
`Entity Entity { index: 16, generation: 3 } does not exist`
Unless we retroactively fix existing log outputs, this is currently producing very ugly logs, not just for Bevy, but for everyone downstream!
Additionally, this still doesn't fix the initial problem, because `fmt::Debug` _still doesn't include the raw bits_.
I can't easily map `Entity { index: 16, generation: 3 }` to `4294967303`.
## My Proposal
To me, `Entity` should not have a `fmt::Display` implementation.
99.9% of the time an entity is only being displaying for debug purposes.
Because of this, I propose `fmt::Debug` should be what `fmt::Display` is now, in addition to the raw bits: i.e. `#v#[rawbits]`
This not only avoids the need to retroactively fix logs, but also solves the initial problem _by including the raw bits_ into the debug output.
Any specialized debugger that needs to show additional data for the entity most likely would need to format it explicitly. Trying to implement `fmt::Display` as a "pretty debug" output is not something I believe Bevy should handle.
---
The only other alternative I see around this issue is that we retroactively fix existing log locations to use `{}` instead of `{:?}` and include the raw bits where appropriate. To me, this is a much more intrusive change.
|
2024-07-30T17:39:55Z
|
1.79
|
2024-08-04T06:18:41Z
|
612897becd415b7b982f58bd76deb719b42c9790
|
[
"entity::tests::entity_debug"
] |
[
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_new",
"change_detection::tests::as_deref_mut",
"change_detection::tests::mut_untyped_to_reflect",
"bundle::tests::component_hook_order_replace",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"bundle::tests::component_hook_order_spawn_despawn",
"entity::map_entities::tests::dyn_entity_mapper_object_safe",
"change_detection::tests::set_if_neq",
"bundle::tests::component_hook_order_insert_remove",
"bundle::tests::component_hook_order_recursive",
"bundle::tests::component_hook_order_recursive_multiple",
"entity::map_entities::tests::entity_mapper",
"entity::tests::entity_bits_roundtrip",
"entity::map_entities::tests::world_scope_reserves_generations",
"change_detection::tests::change_tick_scan",
"entity::tests::entity_comparison",
"change_detection::tests::change_tick_wraparound",
"entity::map_entities::tests::entity_mapper_iteration",
"entity::tests::entity_const",
"change_detection::tests::change_expiration",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::test_event_cursor_clear",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_cursor_len_current",
"event::tests::test_event_cursor_iter_len_updated",
"event::tests::test_event_cursor_len_empty",
"event::tests::test_event_cursor_len_filled",
"event::tests::test_event_cursor_len_update",
"event::tests::test_event_cursor_read",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_event_reader_iter_last",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_events_send_default",
"event::tests::test_events_update_drain",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_kind_bits",
"identifier::masks::tests::pack_into_u64",
"identifier::tests::from_bits",
"identifier::tests::id_comparison",
"identifier::tests::id_construction",
"intern::tests::different_interned_content",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"intern::tests::zero_sized_type",
"label::tests::dyn_eq_object_safe",
"label::tests::dyn_hash_object_safe",
"observer::tests::observer_despawn",
"observer::tests::observer_dynamic_trigger",
"observer::tests::observer_dynamic_component",
"observer::tests::observer_multiple_listeners",
"observer::tests::observer_entity_routing",
"observer::tests::observer_multiple_events",
"observer::tests::observer_multiple_components",
"query::access::tests::filtered_access_extend",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_combined_access",
"query::access::tests::read_all_access_conflicts",
"query::access::tests::test_access_clone",
"query::access::tests::test_access_clone_from",
"query::access::tests::test_access_filters_clone",
"query::access::tests::test_access_filters_clone_from",
"query::access::tests::test_filtered_access_clone",
"query::access::tests::test_filtered_access_clone_from",
"query::access::tests::test_filtered_access_set_from",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"observer::tests::observer_propagating_world_skipping",
"query::access::tests::test_filtered_access_set_clone",
"observer::tests::observer_propagating_halt",
"observer::tests::observer_multiple_matches",
"observer::tests::observer_no_target",
"observer::tests::observer_order_replace",
"query::builder::tests::builder_dynamic_components",
"observer::tests::observer_propagating",
"observer::tests::observer_propagating_no_next",
"observer::tests::observer_propagating_world",
"query::fetch::tests::world_query_metadata_collision",
"observer::tests::observer_order_insert_remove_sparse",
"query::builder::tests::builder_with_without_static",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"observer::tests::observer_propagating_join",
"observer::tests::observer_propagating_parallel_propagation",
"query::builder::tests::builder_transmute",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_struct_variants",
"query::builder::tests::builder_static_components",
"query::state::tests::can_generalize_with_option",
"query::state::tests::can_transmute_added",
"query::builder::tests::builder_or",
"query::iter::tests::query_sorts",
"observer::tests::observer_order_insert_remove",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"observer::tests::observer_order_spawn_despawn",
"query::fetch::tests::world_query_phantom_data",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"query::builder::tests::builder_with_without_dynamic",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_empty_tuple",
"query::iter::tests::query_sort_after_next - should panic",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_immut_fetch",
"observer::tests::observer_order_recursive",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::join",
"query::state::tests::join_with_get",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::tests::has_query",
"query::tests::any_query",
"query::tests::multi_storage_query",
"query::tests::query",
"query::tests::many_entities",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::self_conflicting_worldquery - should panic",
"query::tests::query_iter_combinations_sparse",
"query::tests::derived_worldqueries",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"reflect::entity_commands::tests::insert_reflected",
"query::tests::query_iter_combinations",
"schedule::condition::tests::distributive_run_if_compiles",
"reflect::entity_commands::tests::remove_reflected",
"schedule::set::tests::test_derive_schedule_label",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"schedule::set::tests::test_derive_system_set",
"query::tests::query_filtered_iter_combinations",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::continue_breakpoint",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::stepping::tests::waiting_always_run",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::stepping::tests::stepping_disabled",
"schedule::stepping::tests::step_always_run",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::stepping::tests::unknown_schedule",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::step_breakpoint",
"schedule::stepping::tests::step_never_run",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::stepping::simple_executor",
"schedule::stepping::tests::verify_cursor",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::resources",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::components",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::stepping::single_threaded_executor",
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::resize_test",
"schedule::tests::system_ambiguity::events",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"schedule::tests::system_ambiguity::correct_ambiguities",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::read_world",
"storage::sparse_set::tests::sparse_sets",
"storage::sparse_set::tests::sparse_set",
"system::builder::tests::local_builder",
"storage::table::tests::table",
"system::builder::tests::query_builder",
"system::builder::tests::multi_param_builder",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::commands::tests::append",
"system::function_system::tests::into_system_type_id_consistency",
"system::commands::tests::commands",
"system::commands::tests::remove_resources",
"system::commands::tests::remove_components",
"system::system::tests::command_processing",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"system::commands::tests::remove_components_by_id",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::tests::stepping::multi_threaded_executor",
"system::system::tests::run_system_once",
"system::system::tests::non_send_resources",
"system::system::tests::run_two_systems",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::tests::conditions::system_with_condition",
"system::system_name::tests::test_closure_system_name_regular_param",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"system::system_name::tests::test_system_name_regular_param",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"event::tests::test_event_mutator_iter_nth",
"schedule::schedule::tests::configure_set_on_new_schedule",
"event::tests::test_event_reader_iter_nth",
"system::system_name::tests::test_system_name_exclusive_param",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_const_generics",
"system::system_param::tests::system_param_struct_variants",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_name_collision",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::stepping::tests::step_run_if_false",
"system::system_param::tests::system_param_generic_bounds",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"system::system_registry::tests::change_detection",
"schedule::tests::system_ambiguity::read_only",
"system::system_param::tests::system_param_flexibility",
"system::system_registry::tests::exclusive_system",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::condition::tests::multiple_run_conditions",
"schedule::tests::conditions::systems_with_distributive_condition",
"system::system_param::tests::param_set_non_send_second",
"system::system_registry::tests::input_values",
"system::system_registry::tests::nested_systems",
"system::system_param::tests::system_param_field_limit",
"system::system_param::tests::param_set_non_send_first",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"schedule::tests::system_execution::run_system",
"system::system_registry::tests::output_values",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"system::system_registry::tests::nested_systems_with_inputs",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"system::system_param::tests::non_sync_local",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::schedule::tests::inserts_a_sync_point",
"schedule::schedule::tests::disable_auto_sync_points",
"system::system_registry::tests::local_variables",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"schedule::set::tests::test_schedule_label",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"schedule::tests::system_ordering::add_systems_correct_order",
"system::tests::any_of_and_without",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"system::tests::any_of_has_filter_with_when_both_have_it",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::any_of_with_and_without_common",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"system::tests::any_of_with_mut_and_ref - should panic",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::assert_systems",
"system::tests::any_of_with_ref_and_mut - should panic",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::any_of_with_empty_and_mut",
"system::tests::commands_param_set",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::any_of_with_entity_and_mut",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::any_of_working",
"system::tests::conflicting_system_resources - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::get_system_conflicts",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::immutable_mut_test",
"query::tests::par_iter_mut_change_detection",
"schedule::condition::tests::run_condition_combinators",
"schedule::condition::tests::run_condition",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::long_life_test",
"system::tests::changed_resource_system",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::convert_mut_to_immut",
"schedule::schedule::tests::no_sync_chain::chain_second",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::nonconflicting_system_resources",
"system::tests::disjoint_query_mut_system",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::non_send_option_system",
"system::tests::local_system",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"event::tests::test_event_cursor_par_read_mut",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::non_send_system",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::into_iter_impl",
"schedule::tests::system_ordering::order_systems",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"schedule::schedule::tests::no_sync_chain::chain_all",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::pipe_change_detection",
"system::tests::or_has_filter_with",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::query_validates_world_id - should panic",
"system::tests::read_system_state",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::simple_system",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::system_state_archetype_update",
"system::tests::system_state_change_detection",
"system::tests::query_is_empty",
"system::tests::or_param_set_system",
"system::tests::query_set_system",
"system::tests::panic_inside_system - should panic",
"system::tests::system_state_invalid_world - should panic",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::write_system_state",
"event::tests::test_event_cursor_par_read",
"system::tests::update_archetype_component_access_works",
"tests::added_queries",
"tests::changed_query",
"tests::added_tracking",
"system::tests::world_collections_system",
"tests::add_remove_components",
"tests::clear_entities",
"tests::despawn_mixed_storage",
"system::tests::test_combinator_clone",
"tests::despawn_table_storage",
"system::tests::removal_tracking",
"tests::duplicate_components_panic - should panic",
"tests::changed_trackers",
"tests::empty_spawn",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::changed_trackers_sparse",
"tests::filtered_query_access",
"tests::exact_size_query",
"tests::bundle_derive",
"tests::insert_or_spawn_batch_invalid",
"tests::insert_overwrite_drop",
"tests::insert_overwrite_drop_sparse",
"tests::insert_or_spawn_batch",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::non_send_resource",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::mut_and_mut_query_panic - should panic",
"tests::non_send_resource_points_to_distinct_data",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::non_send_resource_panic - should panic",
"tests::query_all",
"tests::query_all_for_each",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::query_filter_with_sparse",
"tests::par_for_each_sparse",
"tests::query_filter_with_sparse_for_each",
"tests::par_for_each_dense",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_without",
"tests::query_get",
"tests::query_missing_component",
"tests::query_optional_component_sparse",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_sparse_no_match",
"tests::query_optional_component_table",
"tests::query_single_component",
"tests::ref_and_mut_query_panic - should panic",
"tests::random_access",
"tests::query_single_component_for_each",
"tests::query_sparse_component",
"tests::remove_missing",
"tests::remove",
"tests::reserve_and_spawn",
"tests::remove_tracking",
"tests::resource",
"query::tests::query_filtered_exactsizeiterator_len",
"tests::reserve_entities_across_worlds",
"tests::resource_scope",
"tests::sparse_set_add_remove_many",
"tests::spawn_batch",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_is_send",
"tests::take",
"world::command_queue::test::test_command_queue_inner",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_system_param",
"world::identifier::tests::world_id_exclusive_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_by_id",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::reflect::tests::get_component_as_mut_reflect",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iter_resources",
"world::tests::iter_resources_mut",
"world::reflect::tests::get_component_as_reflect",
"world::tests::spawn_empty_bundle",
"world::tests::iterate_entities_mut",
"world::tests::panic_while_overwriting_component",
"world::tests::inspect_entity_components",
"world::tests::iterate_entities",
"world::tests::test_verify_unique_entities",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1009) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1001) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 239) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 1072) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 166) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 249) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 106) - compile fail",
"crates/bevy_ecs/src/component.rs - component::Component (line 141)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 38)",
"crates/bevy_ecs/src/lib.rs - (line 215)",
"crates/bevy_ecs/src/component.rs - component::Component (line 85)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 91)",
"crates/bevy_ecs/src/component.rs - component::Component (line 106)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 60)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1088)",
"crates/bevy_ecs/src/lib.rs - (line 168)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/component.rs - component::Component (line 176)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 100)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 695)",
"crates/bevy_ecs/src/lib.rs - (line 242)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 208)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/lib.rs - (line 290)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper::mappings (line 88)",
"crates/bevy_ecs/src/component.rs - component::Component (line 39)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 197)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 545)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 36)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 122)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 222)",
"crates/bevy_ecs/src/lib.rs - (line 192)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 753)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1324)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 266) - compile fail",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1338)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 214) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 412) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 236) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 379) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 184) - compile fail",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 431) - compile fail",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 101)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 31)",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/label.rs - label::define_label (line 65)",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 27)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 103)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 806)",
"crates/bevy_ecs/src/lib.rs - (line 316)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 778)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 743)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 252)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 244)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 170)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 933)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 844)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1649)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 9)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 123)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 665)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 993)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 63)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 208)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 507)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 288)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 622)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 103)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 113)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 671)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 897)",
"crates/bevy_ecs/src/lib.rs - (line 341)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 228)",
"crates/bevy_ecs/src/lib.rs - (line 257)",
"crates/bevy_ecs/src/lib.rs - (line 127)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 219)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 640)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1672)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 126)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 447)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 295) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 677)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 65)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 207)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 138)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 89)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 715)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 245)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 221)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 790)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 180)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 333)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 265)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 189)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 142)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 152)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 830)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 569)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 353)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 82)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 152)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 156)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 133)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 188)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 890) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1001) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 209)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 769)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 117)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 101)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 584)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 335)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1040)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 488)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 526)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 462) - compile fail",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 473)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1551)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1575) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 562)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 545)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 615)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 375)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 44)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 242)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 949)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 428)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemBuilder (line 12)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 45)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1328)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 730)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 282)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 589)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 873)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 315)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::remove (line 1053)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 250)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 617)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_one_shot_system (line 675)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert (line 1006)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 144)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 128)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 908)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 161)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 794)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::despawn (line 1113)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 69)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 233)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 470)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 646)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::retain (line 1159)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::add (line 1136)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 262)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 182)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 321)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 559)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 433)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 78)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 822)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1263)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1508)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 785)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 417)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1110)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1228)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 350)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 116) - compile",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 257)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1082)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 27)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 786)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 260)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1157)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1187)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 616)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 943)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 240)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 49)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 763)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 227)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 908)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1551)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 195)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 178)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 195)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1363)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1636)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1306)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1395)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1152)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 455)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1603)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1743)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1548)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1416)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 385)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 340)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 266)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1720)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1492)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1109)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1518)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 314)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1577)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 374)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 219)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 803)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2495)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 2272)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1696)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1800)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1663)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 422)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 540)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1775)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1808)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 834)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 697)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 610)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1056)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 745)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 413)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 575)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1077)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 925)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2517)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1218)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 467)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 456)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 2594)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2857)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1971)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1024)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 31)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1249)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 892)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1182)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 14,380
|
bevyengine__bevy-14380
|
[
"14378"
] |
a8530ebbc83f6f53751bfbcfc128db0764a5d2b3
|
diff --git a/crates/bevy_reflect/src/array.rs b/crates/bevy_reflect/src/array.rs
--- a/crates/bevy_reflect/src/array.rs
+++ b/crates/bevy_reflect/src/array.rs
@@ -74,6 +74,11 @@ pub trait Array: PartialReflect {
values: self.iter().map(PartialReflect::clone_value).collect(),
}
}
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ fn get_represented_array_info(&self) -> Option<&'static ArrayInfo> {
+ self.get_represented_type_info()?.as_array().ok()
+ }
}
/// A container for compile-time array info.
diff --git a/crates/bevy_reflect/src/enums/enum_trait.rs b/crates/bevy_reflect/src/enums/enum_trait.rs
--- a/crates/bevy_reflect/src/enums/enum_trait.rs
+++ b/crates/bevy_reflect/src/enums/enum_trait.rs
@@ -133,6 +133,13 @@ pub trait Enum: PartialReflect {
fn variant_path(&self) -> String {
format!("{}::{}", self.reflect_type_path(), self.variant_name())
}
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ ///
+ /// [`TypeInfo`]: crate::TypeInfo
+ fn get_represented_enum_info(&self) -> Option<&'static EnumInfo> {
+ self.get_represented_type_info()?.as_enum().ok()
+ }
}
/// A container for compile-time enum info, used by [`TypeInfo`](crate::TypeInfo).
diff --git a/crates/bevy_reflect/src/list.rs b/crates/bevy_reflect/src/list.rs
--- a/crates/bevy_reflect/src/list.rs
+++ b/crates/bevy_reflect/src/list.rs
@@ -109,6 +109,11 @@ pub trait List: PartialReflect {
values: self.iter().map(PartialReflect::clone_value).collect(),
}
}
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ fn get_represented_list_info(&self) -> Option<&'static ListInfo> {
+ self.get_represented_type_info()?.as_list().ok()
+ }
}
/// A container for compile-time list info.
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -99,6 +99,11 @@ pub trait Map: PartialReflect {
/// If the map did not have this key present, `None` is returned.
/// If the map did have this key present, the removed value is returned.
fn remove(&mut self, key: &dyn PartialReflect) -> Option<Box<dyn PartialReflect>>;
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ fn get_represented_map_info(&self) -> Option<&'static MapInfo> {
+ self.get_represented_type_info()?.as_map().ok()
+ }
}
/// A container for compile-time map info.
diff --git a/crates/bevy_reflect/src/struct_trait.rs b/crates/bevy_reflect/src/struct_trait.rs
--- a/crates/bevy_reflect/src/struct_trait.rs
+++ b/crates/bevy_reflect/src/struct_trait.rs
@@ -73,6 +73,11 @@ pub trait Struct: PartialReflect {
/// Clones the struct into a [`DynamicStruct`].
fn clone_dynamic(&self) -> DynamicStruct;
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ fn get_represented_struct_info(&self) -> Option<&'static StructInfo> {
+ self.get_represented_type_info()?.as_struct().ok()
+ }
}
/// A container for compile-time named struct info.
diff --git a/crates/bevy_reflect/src/tuple.rs b/crates/bevy_reflect/src/tuple.rs
--- a/crates/bevy_reflect/src/tuple.rs
+++ b/crates/bevy_reflect/src/tuple.rs
@@ -56,6 +56,11 @@ pub trait Tuple: PartialReflect {
/// Clones the struct into a [`DynamicTuple`].
fn clone_dynamic(&self) -> DynamicTuple;
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ fn get_represented_tuple_info(&self) -> Option<&'static TupleInfo> {
+ self.get_represented_type_info()?.as_tuple().ok()
+ }
}
/// An iterator over the field values of a tuple.
diff --git a/crates/bevy_reflect/src/tuple_struct.rs b/crates/bevy_reflect/src/tuple_struct.rs
--- a/crates/bevy_reflect/src/tuple_struct.rs
+++ b/crates/bevy_reflect/src/tuple_struct.rs
@@ -57,6 +57,11 @@ pub trait TupleStruct: PartialReflect {
/// Clones the struct into a [`DynamicTupleStruct`].
fn clone_dynamic(&self) -> DynamicTupleStruct;
+
+ /// Will return `None` if [`TypeInfo`] is not available.
+ fn get_represented_tuple_struct_info(&self) -> Option<&'static TupleStructInfo> {
+ self.get_represented_type_info()?.as_tuple_struct().ok()
+ }
}
/// A container for compile-time tuple struct info.
|
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -1864,6 +1864,41 @@ mod tests {
assert!(info.is::<MyValue>());
}
+ #[test]
+ fn get_represented_kind_info() {
+ #[derive(Reflect)]
+ struct SomeStruct;
+
+ #[derive(Reflect)]
+ struct SomeTupleStruct(f32);
+
+ #[derive(Reflect)]
+ enum SomeEnum {
+ Foo,
+ Bar,
+ }
+
+ let dyn_struct: &dyn Struct = &SomeStruct;
+ let _: &StructInfo = dyn_struct.get_represented_struct_info().unwrap();
+
+ let dyn_map: &dyn Map = &HashMap::<(), ()>::default();
+ let _: &MapInfo = dyn_map.get_represented_map_info().unwrap();
+
+ let dyn_array: &dyn Array = &[1, 2, 3];
+ let _: &ArrayInfo = dyn_array.get_represented_array_info().unwrap();
+
+ let dyn_list: &dyn List = &vec![1, 2, 3];
+ let _: &ListInfo = dyn_list.get_represented_list_info().unwrap();
+
+ let dyn_tuple_struct: &dyn TupleStruct = &SomeTupleStruct(5.0);
+ let _: &TupleStructInfo = dyn_tuple_struct
+ .get_represented_tuple_struct_info()
+ .unwrap();
+
+ let dyn_enum: &dyn Enum = &SomeEnum::Foo;
+ let _: &EnumInfo = dyn_enum.get_represented_enum_info().unwrap();
+ }
+
#[test]
fn should_permit_higher_ranked_lifetimes() {
#[derive(Reflect)]
|
bevy_reflect: Consider API for getting kind info
## What problem does this solve or what need does it fill?
Let's say I have this:
```rust
if let bevy_reflect::ReflectMut::Struct(s) = reflected.reflect_mut() {
let Some(bevy_reflect::TypeInfo::Struct(info)) = s.get_represented_type_info() else {
return;
}
}
```
In order to get the `StructInfo` type I need to do this extra match where I specifically ask for a `StructInfo`.
But since I already got `s` from `Struct(s)`, from a usage perspective it feels like it should be implied that I want a `StructInfo` and not an e.g. `EnumInfo`.
## What solution would you like?
```rust
if let bevy_reflect::ReflectMut::Struct(s) = reflected.reflect_mut() {
let Some(info) = s.get_kind_info() else {
return;
}
}
```
Something along the lines of the above, but also for `MapInfo`, `ListInfo`, etc.
|
Seems reasonable. Want to put together a PR?
Yeah this would be a good improvement. Although, rather than `get_kind_info` maybe we should call it `get_represented_kind_info` since it's the info of the represented type that we want (and for parity with the method on `Reflect`).
> Seems reasonable. Want to put together a PR?
Taking a look.
> maybe we should call it `get_represented_kind_info`
Sounds good
|
2024-07-18T17:37:45Z
|
1.81
|
2024-10-15T02:25:58Z
|
60b2c7ce7755a49381c5265021ff175d3624218c
|
[
"array::tests::next_index_increment",
"attributes::tests::should_allow_unit_struct_attribute_values",
"attributes::tests::should_accept_last_attribute",
"attributes::tests::should_derive_custom_attributes_on_struct_container",
"attributes::tests::should_debug_custom_attributes",
"attributes::tests::should_derive_custom_attributes_on_enum_variant_fields",
"attributes::tests::should_derive_custom_attributes_on_enum_container",
"attributes::tests::should_derive_custom_attributes_on_struct_fields",
"attributes::tests::should_derive_custom_attributes_on_enum_variants",
"attributes::tests::should_derive_custom_attributes_on_tuple_struct_fields",
"attributes::tests::should_derive_custom_attributes_on_tuple_container",
"attributes::tests::should_get_custom_attribute",
"attributes::tests::should_get_custom_attribute_dynamically",
"enums::enum_trait::tests::next_index_increment",
"enums::tests::dynamic_enum_should_return_is_dynamic",
"enums::tests::dynamic_enum_should_apply_dynamic_enum",
"enums::tests::dynamic_enum_should_change_variant",
"enums::tests::applying_non_enum_should_panic - should panic",
"enums::tests::dynamic_enum_should_set_variant_fields",
"enums::tests::enum_should_allow_nesting_enums",
"enums::tests::enum_should_allow_struct_fields",
"enums::tests::enum_should_allow_generics",
"enums::tests::enum_should_apply",
"enums::tests::enum_should_iterate_fields",
"enums::tests::enum_should_partial_eq",
"enums::tests::enum_should_return_correct_variant_path",
"enums::tests::enum_should_return_correct_variant_type",
"enums::tests::enum_should_set",
"enums::tests::enum_try_apply_should_detect_type_mismatch",
"enums::tests::partial_dynamic_enum_should_set_variant_fields",
"enums::tests::should_get_enum_type_info",
"enums::variants::tests::should_return_error_on_invalid_cast",
"enums::tests::should_skip_ignored_fields",
"func::args::list::tests::should_pop_args_in_reverse_order",
"func::args::list::tests::should_push_arg_with_correct_ownership",
"func::args::list::tests::should_push_arguments_in_order",
"func::args::list::tests::should_reindex_on_push_after_take",
"func::args::list::tests::should_take_args_in_order",
"func::dynamic_function::tests::should_allow_recursive_dynamic_function",
"func::dynamic_function::tests::should_apply_function",
"func::dynamic_function::tests::should_clone_dynamic_function",
"func::dynamic_function::tests::should_convert_dynamic_function_with_into_function",
"func::dynamic_function::tests::should_return_error_on_arg_count_mismatch",
"func::dynamic_function::tests::should_overwrite_function_name",
"func::dynamic_function_mut::tests::should_convert_dynamic_function_mut_with_into_function",
"func::dynamic_function_mut::tests::should_overwrite_function_name",
"func::dynamic_function_mut::tests::should_return_error_on_arg_count_mismatch",
"func::function::tests::should_call_dyn_function",
"func::info::tests::should_create_anonymous_function_info",
"func::info::tests::should_create_closure_info",
"func::info::tests::should_create_function_info",
"func::info::tests::should_create_function_pointer_info",
"func::into_function::tests::should_create_dynamic_function_from_closure",
"func::into_function::tests::should_create_dynamic_function_from_function",
"func::into_function::tests::should_default_closure_name_to_none",
"func::into_function_mut::tests::should_create_dynamic_function_mut_from_closure",
"func::into_function_mut::tests::should_create_dynamic_function_mut_from_closure_with_mutable_capture",
"func::into_function_mut::tests::should_create_dynamic_function_mut_from_function",
"func::into_function_mut::tests::should_default_closure_name_to_none",
"func::registry::tests::should_allow_overwriting_registration",
"func::registry::tests::should_call_function_via_registry",
"func::registry::tests::should_debug_function_registry",
"func::registry::tests::should_error_on_missing_name",
"func::registry::tests::should_only_register_function_once",
"func::registry::tests::should_register_anonymous_function",
"func::registry::tests::should_register_closure",
"func::registry::tests::should_register_dynamic_closure",
"func::registry::tests::should_register_dynamic_function",
"func::registry::tests::should_register_function",
"func::tests::should_error_on_invalid_arg_ownership",
"func::tests::should_error_on_invalid_arg_type",
"func::tests::should_error_on_missing_args",
"func::tests::should_error_on_too_many_args",
"generics::tests::should_maintain_order",
"generics::tests::should_get_by_name",
"generics::tests::should_store_defaults",
"impls::smol_str::tests::smolstr_should_from_reflect",
"impls::smol_str::tests::should_partial_eq_smolstr",
"impls::std::tests::instant_should_from_reflect",
"impls::std::tests::nonzero_usize_impl_reflect_from_reflect",
"impls::std::tests::option_should_apply",
"impls::std::tests::option_should_from_reflect",
"impls::std::tests::option_should_impl_enum",
"impls::std::tests::path_should_from_reflect",
"impls::std::tests::option_should_impl_typed",
"impls::std::tests::can_serialize_duration",
"impls::std::tests::should_partial_eq_btree_map",
"impls::std::tests::should_partial_eq_char",
"impls::std::tests::should_partial_eq_hash_map",
"impls::std::tests::should_partial_eq_i32",
"impls::std::tests::should_partial_eq_vec",
"impls::std::tests::should_partial_eq_option",
"impls::std::tests::should_partial_eq_string",
"impls::std::tests::should_partial_eq_f32",
"impls::std::tests::static_str_should_from_reflect",
"impls::glam::tests::euler_rot_serialization",
"impls::glam::tests::euler_rot_deserialization",
"kind::tests::should_cast_owned",
"kind::tests::should_cast_ref",
"list::tests::next_index_increment",
"kind::tests::should_cast_mut",
"map::tests::remove",
"impls::std::tests::type_id_should_from_reflect",
"map::tests::test_map_get_at",
"path::parse::test::parse_invalid",
"map::tests::test_map_get_at_mut",
"list::tests::test_into_iter",
"map::tests::test_into_iter",
"map::tests::next_index_increment",
"path::tests::accept_leading_tokens",
"path::tests::reflect_array_behaves_like_list",
"path::tests::parsed_path_parse",
"path::tests::try_from",
"path::tests::reflect_array_behaves_like_list_mut",
"path::tests::reflect_path",
"path::tests::parsed_path_get_field",
"serde::de::tests::functions::should_not_deserialize_function",
"serde::de::tests::should_return_error_if_missing_type_data",
"serde::de::tests::should_deserialize_value",
"serde::ser::tests::functions::should_not_serialize_function",
"struct_trait::tests::next_index_increment",
"serde::ser::tests::debug_stack::should_report_context_in_errors",
"serde::ser::tests::should_return_error_if_missing_type_data",
"tests::docstrings::should_not_contain_docs",
"tests::docstrings::fields_should_contain_docs",
"tests::as_reflect",
"serde::de::tests::should_deserialize_option",
"set::tests::test_into_iter",
"serde::ser::tests::should_return_error_if_missing_registration",
"tests::custom_debug_function",
"serde::de::tests::enum_should_deserialize",
"serde::tests::should_not_serialize_unproxied_dynamic - should panic",
"serde::de::tests::should_deserialized_typed",
"tests::assert_impl_reflect_macro_on_all",
"serde::de::tests::should_deserialize_non_self_describing_binary",
"tests::from_reflect_should_allow_ignored_unnamed_fields",
"tests::from_reflect_should_use_default_variant_field_attributes",
"tests::glam::quat_deserialization",
"tests::from_reflect_should_use_default_container_attribute",
"tests::docstrings::variants_should_contain_docs",
"serde::ser::tests::should_serialize_dynamic_option",
"tests::reflect_downcast",
"tests::can_opt_out_type_path",
"tests::reflect_ignore",
"tests::from_reflect_should_use_default_field_attributes",
"tests::recursive_registration_does_not_hang",
"tests::reflect_map",
"tests::glam::vec3_apply_dynamic",
"tests::glam::vec3_field_access",
"tests::glam::vec3_path_access",
"tests::into_reflect",
"serde::de::tests::debug_stack::should_report_context_in_errors",
"tests::recursive_typed_storage_does_not_hang",
"serde::tests::test_serialization_struct",
"serde::ser::tests::enum_should_serialize",
"serde::tests::type_data::should_serialize_with_serialize_with_registry",
"serde::de::tests::should_deserialize",
"tests::docstrings::should_contain_docs",
"tests::not_dynamic_names",
"serde::tests::should_roundtrip_proxied_dynamic",
"tests::multiple_reflect_lists",
"tests::reflect_unit_struct",
"tests::should_allow_custom_where",
"tests::should_allow_empty_custom_where",
"tests::reflect_take",
"tests::reflect_struct",
"serde::tests::type_data::should_serialize_single_tuple_struct_as_newtype",
"serde::ser::tests::should_serialize_self_describing_binary",
"tests::glam::vec3_serialization",
"tests::reflect_complex_patch",
"tests::dynamic_types_debug_format",
"tests::should_permit_higher_ranked_lifetimes",
"tests::should_permit_valid_represented_type_for_dynamic",
"tests::reflect_type_path",
"tests::should_drain_fields",
"serde::ser::tests::should_serialize_non_self_describing_binary",
"tests::glam::vec3_deserialization",
"tests::glam::quat_serialization",
"tests::should_not_auto_register_existing_types",
"serde::ser::tests::should_serialize_option",
"serde::ser::tests::should_serialize",
"tests::should_reflect_nested_remote_type",
"tests::should_reflect_remote_type_from_module",
"tests::should_call_from_reflect_dynamically",
"tests::should_allow_multiple_custom_where",
"tests::should_auto_register_fields",
"serde::tests::type_data::should_deserialize_with_deserialize_with_registry",
"serde::tests::test_serialization_tuple_struct",
"tests::should_allow_dynamic_fields",
"tests::should_reflect_remote_value_type",
"tests::should_take_nested_remote_type",
"tests::should_allow_custom_where_with_assoc_type",
"tests::should_reflect_remote_enum",
"tests::should_take_remote_type",
"tests::should_try_take_remote_type",
"tests::should_reflect_remote_type",
"tests::should_reflect_nested_remote_enum",
"tests::should_reflect_debug",
"tests::try_apply_should_detect_kinds",
"tests::std_type_paths",
"tests::should_prohibit_invalid_represented_type_for_dynamic - should panic",
"tests::reflect_map_no_hash - should panic",
"tests::reflect_map_no_hash_dynamic - should panic",
"tests::reflect_map_no_hash_dynamic_representing - should panic",
"serde::de::tests::should_deserialize_self_describing_binary",
"tests::reflect_type_info",
"type_registry::test::test_reflect_from_ptr",
"tuple::tests::next_index_increment",
"type_registry::test::type_data_iter",
"type_registry::test::type_data_iter_mut",
"tuple_struct::tests::next_index_increment",
"type_info::tests::should_return_error_on_invalid_cast",
"tests::reflect_serialize",
"serde::de::tests::should_reserialize",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Struct (line 16)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Struct (line 60)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Unit (line 78)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Unit (line 34)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Tuple (line 26)",
"crates/bevy_reflect/src/func/mod.rs - func (line 47)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Tuple (line 70)",
"crates/bevy_reflect/src/func/mod.rs - func (line 60)",
"crates/bevy_reflect/src/reflectable.rs - reflectable::Reflectable (line 22)",
"crates/bevy_reflect/src/lib.rs - (line 86)",
"crates/bevy_reflect/src/lib.rs - (line 347)",
"crates/bevy_reflect/src/remote.rs - remote::ReflectRemote (line 22)",
"crates/bevy_reflect/src/func/args/arg.rs - func::args::arg::Arg<'a>::take_ref (line 112)",
"crates/bevy_reflect/src/func/info.rs - func::info::TypedFunction (line 193)",
"crates/bevy_reflect/src/func/args/arg.rs - func::args::arg::Arg<'a>::take (line 49)",
"crates/bevy_reflect/src/lib.rs - (line 156)",
"crates/bevy_reflect/src/array.rs - array::Array (line 32)",
"crates/bevy_reflect/src/func/dynamic_function.rs - func::dynamic_function::DynamicFunction (line 34)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::pop_owned (line 237)",
"crates/bevy_reflect/src/func/dynamic_function_mut.rs - func::dynamic_function_mut::DynamicFunctionMut<'env>::call_once (line 155)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 329)",
"crates/bevy_reflect/src/func/dynamic_function.rs - func::dynamic_function::DynamicFunction<'env>::call (line 96)",
"crates/bevy_reflect/src/enums/dynamic_enum.rs - enums::dynamic_enum::DynamicEnum (line 43)",
"crates/bevy_reflect/src/func/function.rs - func::function::Function (line 18)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::pop (line 209)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::pop_mut (line 275)",
"crates/bevy_reflect/src/func/args/arg.rs - func::args::arg::Arg<'a>::take_owned (line 77)",
"crates/bevy_reflect/src/enums/helpers.rs - enums::helpers::enum_debug (line 84)",
"crates/bevy_reflect/src/lib.rs - (line 228)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 317)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::take_mut (line 184)",
"crates/bevy_reflect/src/lib.rs - (line 242)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 161)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 83)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 147)",
"crates/bevy_reflect/src/type_info.rs - type_info::Typed (line 34)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 124)",
"crates/bevy_reflect/src/lib.rs - (line 326)",
"crates/bevy_reflect/src/type_path.rs - type_path::TypePath (line 39)",
"crates/bevy_reflect/src/lib.rs - (line 134)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 188)",
"crates/bevy_reflect/src/map.rs - map::Map (line 31)",
"crates/bevy_reflect/src/serde/type_data.rs - serde::type_data::SerializationData::is_field_skipped (line 28)",
"crates/bevy_reflect/src/utility.rs - utility::NonGenericTypeCell (line 50)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 139)",
"crates/bevy_reflect/src/set.rs - set::set_debug (line 433)",
"crates/bevy_reflect/src/lib.rs - (line 194)",
"crates/bevy_reflect/src/func/mod.rs - func (line 17)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::take_ref (line 165)",
"crates/bevy_reflect/src/set.rs - set::Set (line 31)",
"crates/bevy_reflect/src/serde/ser/serializer.rs - serde::ser::serializer::TypedReflectSerializer (line 106)",
"crates/bevy_reflect/src/func/reflect_fn.rs - func::reflect_fn::ReflectFn (line 39)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 341)",
"crates/bevy_reflect/src/lib.rs - (line 208)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath::parse (line 374)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 63)",
"crates/bevy_reflect/src/func/reflect_fn_mut.rs - func::reflect_fn_mut::ReflectFnMut (line 41)",
"crates/bevy_reflect/src/func/registry.rs - func::registry::FunctionRegistry::register_with_name (line 183)",
"crates/bevy_reflect/src/func/registry.rs - func::registry::FunctionRegistry::register (line 64)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::pop_ref (line 256)",
"crates/bevy_reflect/src/generics.rs - generics::TypeParamInfo::default (line 139)",
"crates/bevy_reflect/src/func/registry.rs - func::registry::FunctionRegistry::register (line 49)",
"crates/bevy_reflect/src/func/mod.rs - func (line 102)",
"crates/bevy_reflect/src/attributes.rs - attributes::CustomAttributes (line 17)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList (line 14)",
"crates/bevy_reflect/src/tuple.rs - tuple::Tuple (line 27)",
"crates/bevy_reflect/src/func/args/arg.rs - func::args::arg::Arg<'a>::take_mut (line 151)",
"crates/bevy_reflect/src/func/registry.rs - func::registry::FunctionRegistry::register (line 84)",
"crates/bevy_reflect/src/func/dynamic_function_mut.rs - func::dynamic_function_mut::DynamicFunctionMut<'env>::call (line 112)",
"crates/bevy_reflect/src/lib.rs - (line 267)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::take (line 118)",
"crates/bevy_reflect/src/func/args/list.rs - func::args::list::ArgList<'a>::take_owned (line 146)",
"crates/bevy_reflect/src/func/registry.rs - func::registry::FunctionRegistry::register_with_name (line 154)",
"crates/bevy_reflect/src/lib.rs - (line 298)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistration (line 455)",
"crates/bevy_reflect/src/list.rs - list::List (line 40)",
"crates/bevy_reflect/src/func/dynamic_function_mut.rs - func::dynamic_function_mut::DynamicFunctionMut (line 29)",
"crates/bevy_reflect/src/generics.rs - generics::ConstParamInfo::default (line 197)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::is_ambiguous (line 353)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 183)",
"crates/bevy_reflect/src/lib.rs - (line 366)",
"crates/bevy_reflect/src/type_info.rs - type_info::Type (line 361)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register_type_data (line 256)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 213)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::Struct (line 28)",
"crates/bevy_reflect/src/serde/de/deserializer.rs - serde::de::deserializer::TypedReflectDeserializer (line 180)",
"crates/bevy_reflect/src/serde/type_data.rs - serde::type_data::SerializationData::generate_default (line 68)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::TupleStruct (line 27)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::ReflectFromPtr (line 746)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register (line 133)",
"crates/bevy_reflect/src/lib.rs - (line 409)",
"crates/bevy_reflect/src/serde/de/deserializer.rs - serde::de::deserializer::ReflectDeserializer (line 47)",
"crates/bevy_reflect/src/serde/ser/serializer.rs - serde::ser::serializer::ReflectSerializer (line 28)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 8,040
|
bevyengine__bevy-8040
|
[
"8034"
] |
ee0e6f485575952fb51d38f807f60907272e1d44
|
diff --git a/crates/bevy_render/src/color/mod.rs b/crates/bevy_render/src/color/mod.rs
--- a/crates/bevy_render/src/color/mod.rs
+++ b/crates/bevy_render/src/color/mod.rs
@@ -525,7 +525,7 @@ impl Color {
let [red, green, blue] =
LchRepresentation::lch_to_nonlinear_srgb(*lightness, *chroma, *hue);
- Color::Rgba {
+ Color::RgbaLinear {
red: red.nonlinear_to_linear_srgb(),
green: green.nonlinear_to_linear_srgb(),
blue: blue.nonlinear_to_linear_srgb(),
|
diff --git a/crates/bevy_render/src/color/mod.rs b/crates/bevy_render/src/color/mod.rs
--- a/crates/bevy_render/src/color/mod.rs
+++ b/crates/bevy_render/src/color/mod.rs
@@ -1858,4 +1858,22 @@ mod tests {
assert_eq!(starting_color * transformation, mutated_color,);
}
+
+ // regression test for https://github.com/bevyengine/bevy/pull/8040
+ #[test]
+ fn convert_to_rgba_linear() {
+ let rgba = Color::rgba(0., 0., 0., 0.);
+ let rgba_l = Color::rgba_linear(0., 0., 0., 0.);
+ let hsla = Color::hsla(0., 0., 0., 0.);
+ let lcha = Color::Lcha {
+ lightness: 0.0,
+ chroma: 0.0,
+ hue: 0.0,
+ alpha: 0.0,
+ };
+ assert_eq!(rgba_l, rgba_l.as_rgba_linear());
+ let Color::RgbaLinear { .. } = rgba.as_rgba_linear() else { panic!("from Rgba") };
+ let Color::RgbaLinear { .. } = hsla.as_rgba_linear() else { panic!("from Hsla") };
+ let Color::RgbaLinear { .. } = lcha.as_rgba_linear() else { panic!("from Lcha") };
+ }
}
|
Crash when setting background color via Color::Lcha
## Bevy version
0.10.0
## \[Optional\] Relevant system information
rustc 1.68.0
SystemInfo { os: "Linux 22.0.4 Manjaro Linux", kernel: "5.15.94-1-MANJARO", cpu: "AMD Ryzen 7 2700X Eight-Core Processor", core_count: "8", memory: "15.6 GiB" }
AdapterInfo { name: "NVIDIA GeForce RTX 2070 SUPER", vendor: 4318, device: 7812, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.89.02", backend: Vulkan }
## What you did
I set the background color in a project using `Color::Lcha {...}`.
Minimal example:
```rust
fn main() {
App::new()
.insert_resource(
ClearColor(Color::Lcha {
lightness: 80.,
chroma: 20.,
hue: 100.,
alpha: 0.,
}), /*.as_rgba() makes the problem go away */
)
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
}
```
## What went wrong
With great anticipation, I awaited the sight of a mesmerizing background color, one that would transport me to a world of beauty and wonder. Alas, my hopes were shattered as the app crashed before my very eyes, leaving me stranded in a void of disappointment and frustration.
## Additional information
Console output:
```txt
2023-03-10T23:42:39.181041Z INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-03-10T23:42:39.181279Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2023-03-10T23:42:39.254333Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 2070 SUPER", vendor: 4318, device: 7812, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.89.02", backend: Vulkan }
2023-03-10T23:42:39.818207Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 22.0.4 Manjaro Linux", kernel: "5.15.94-1-MANJARO", cpu: "AMD Ryzen 7 2700X Eight-Core Processor", core_count: "8", memory: "15.6 GiB" }
thread '<unnamed>' panicked at 'internal error: entered unreachable code', /home/~/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.10.0/src/color/mod.rs:1155:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'Compute Task Pool (2)' panicked at 'A system has panicked so the executor cannot continue.: RecvError', /home/~/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.10.0/src/schedule/executor/multi_threaded.rs:194:60
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/~/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.10.0/src/task_pool.rs:376:49
thread 'Compute Task Pool (2)' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', /home/~/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.10.0/src/pipelined_rendering.rs:136:45
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/~/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.10.0/src/task_pool.rs:376:49
```
Converting the Lcha color to RGBA yielded the expected result, but I found the crash quit surprising, since all other variants of `Color` can be used to set the background color.
|
There is a wrong return value in Color::as_rgba_linear. I make a PR
|
2023-03-11T10:56:59Z
|
1.67
|
2023-03-11T12:32:56Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"color::tests::convert_to_rgba_linear"
] |
[
"mesh::mesh::conversions::tests::vec3a",
"color::tests::mul_and_mulassign_f32",
"primitives::tests::intersects_sphere_big_frustum_outside",
"mesh::mesh::conversions::tests::correct_message",
"color::tests::mul_and_mulassign_f32by3",
"color::colorspace::test::lch_to_srgb",
"color::colorspace::test::srgb_to_lch",
"mesh::mesh::conversions::tests::i32_4",
"color::colorspace::test::srgb_linear_full_roundtrip",
"mesh::mesh::conversions::tests::f32_4",
"color::tests::conversions_vec4",
"mesh::mesh::conversions::tests::f32_2",
"color::tests::mul_and_mulassign_vec4",
"primitives::tests::intersects_sphere_big_frustum_intersect",
"color::tests::mul_and_mulassign_vec3",
"mesh::mesh::conversions::tests::u32",
"mesh::mesh::conversions::tests::uvec4",
"mesh::mesh::conversions::tests::vec3",
"mesh::mesh::conversions::tests::u32_2",
"color::tests::mul_and_mulassign_f32by4",
"mesh::mesh::conversions::tests::f32",
"mesh::mesh::conversions::tests::i32",
"color::colorspace::test::srgb_to_hsl",
"mesh::mesh::conversions::tests::ivec4",
"mesh::mesh::conversions::tests::i32_2",
"mesh::mesh::conversions::tests::uvec2",
"mesh::mesh::conversions::tests::f32_3",
"color::colorspace::test::hsl_to_srgb",
"mesh::mesh::tests::panic_invalid_format - should panic",
"primitives::tests::intersects_sphere_frustum_intersects_2_planes",
"mesh::mesh::conversions::tests::ivec3",
"mesh::mesh::conversions::tests::i32_3",
"mesh::mesh::conversions::tests::uvec3",
"mesh::mesh::conversions::tests::ivec2",
"primitives::tests::intersects_sphere_frustum_contained",
"mesh::mesh::conversions::tests::vec2",
"primitives::tests::intersects_sphere_long_frustum_outside",
"color::tests::hex_color",
"primitives::tests::intersects_sphere_long_frustum_intersect",
"texture::image_texture_conversion::test::two_way_conversion",
"render_graph::graph::tests::test_slot_already_occupied",
"render_phase::rangefinder::tests::distance",
"render_phase::tests::batching",
"primitives::tests::intersects_sphere_frustum_dodges_1_plane",
"mesh::mesh::conversions::tests::u32_3",
"mesh::mesh::conversions::tests::u32_4",
"primitives::tests::intersects_sphere_frustum_intersects_3_planes",
"primitives::tests::intersects_sphere_frustum_surrounding",
"view::visibility::render_layers::rendering_mask_tests::rendering_mask_sanity",
"view::visibility::test::ensure_visibility_enum_size",
"texture::image::test::image_default_size",
"primitives::tests::intersects_sphere_frustum_intersects_plane",
"mesh::mesh::conversions::tests::vec4",
"render_graph::graph::tests::test_graph_edges",
"render_graph::graph::tests::test_edge_already_exists",
"render_graph::graph::tests::test_get_node_typed",
"view::visibility::test::visibility_propagation_unconditional_visible",
"texture::image::test::image_size",
"view::visibility::test::visibility_propagation",
"render_resource::shader::tests::process_shader_def_else_ifdef_ends_up_in_third_clause",
"render_resource::shader::tests::process_nested_shader_def_outer_defined_inner_not",
"render_resource::shader::tests::process_shader_def_equal_bool",
"render_resource::shader::tests::process_shader_def_defined",
"render_resource::shader::tests::process_shader_def_else_ifdef_ends_up_in_second_clause",
"render_resource::shader::tests::process_nested_shader_def_neither_defined_else",
"render_resource::shader::tests::process_shader_def_not_equal_bool",
"render_resource::shader::tests::process_shader_def_not_defined",
"render_resource::shader::tests::process_import_ifdef",
"render_resource::shader::tests::process_import_in_ifdef",
"render_resource::shader::tests::process_nested_shader_def_neither_defined",
"render_resource::shader::tests::process_shader_define_only_in_accepting_scopes",
"render_resource::shader::tests::process_nested_shader_def_outer_defined_inner_else",
"render_resource::shader::tests::process_shader_def_unknown_operator",
"render_resource::shader::tests::process_shader_def_else",
"render_resource::shader::tests::process_shader_def_unclosed",
"render_resource::shader::tests::process_shader_def_else_ifdef_no_match_and_no_fallback_else",
"render_resource::shader::tests::process_nested_shader_def_both_defined",
"render_resource::shader::tests::process_shader_def_else_ifdef_only_accepts_one_valid_else_ifdef",
"render_resource::shader::tests::process_nested_shader_def_inner_defined_outer_not",
"render_resource::shader::tests::process_shader_def_replace",
"render_resource::shader::tests::process_shader_def_equal_int",
"render_resource::shader::tests::process_shader_define_across_imports",
"render_resource::shader::tests::process_import_glsl",
"render_resource::shader::tests::process_shader_def_too_closed",
"render_resource::shader::tests::process_shader_def_else_ifdef_ends_up_in_first_clause",
"render_resource::shader::tests::process_import_wgsl",
"render_resource::shader::tests::process_shader_define_in_shader_with_value",
"render_resource::shader::tests::process_shader_def_else_ifdef_complicated_nesting",
"render_resource::shader::tests::process_shader_def_commented",
"render_resource::shader::tests::process_shader_def_else_ifdef_ends_up_in_else",
"render_resource::shader::tests::process_import_in_import",
"render_resource::shader::tests::process_shader_define_in_shader",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::draw_indexed_indirect (line 291)",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::multi_draw_indirect_count (line 357)",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::multi_draw_indexed_indirect_count (line 440)",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::draw_indirect (line 268)",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::multi_draw_indexed_indirect (line 400)",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::multi_draw_indirect (line 319)",
"src/render_phase/draw_state.rs - render_phase::draw_state::TrackedRenderPass<'a>::push_debug_group (line 557)",
"src/render_resource/bind_group.rs - render_resource::bind_group::AsBindGroup (line 243)",
"src/render_resource/bind_group.rs - render_resource::bind_group::AsBindGroup (line 217)",
"src/render_resource/bind_group.rs - render_resource::bind_group::AsBindGroup (line 179)",
"src/extract_param.rs - extract_param::Extract (line 29)",
"src/render_resource/bind_group.rs - render_resource::bind_group::AsBindGroup (line 75)",
"src/render_resource/bind_group.rs - render_resource::bind_group::AsBindGroup (line 151)",
"src/mesh/mesh/mod.rs - mesh::mesh::Mesh (line 47)",
"src/render_resource/bind_group.rs - render_resource::bind_group::AsBindGroup (line 163)",
"src/mesh/mesh/conversions.rs - mesh::mesh::conversions (line 6)",
"src/render_graph/graph.rs - render_graph::graph::RenderGraph (line 32)",
"src/color/mod.rs - color::Color::hex (line 260)",
"src/view/mod.rs - view::Msaa (line 79)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 8,014
|
bevyengine__bevy-8014
|
[
"7989"
] |
7d9cb1c4ab210595c5228af0ed4ec7d095241db5
|
diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
--- a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
+++ b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
@@ -3,7 +3,7 @@ use crate::derive_data::ReflectEnum;
use crate::enum_utility::{get_variant_constructors, EnumVariantConstructors};
use crate::field_attributes::DefaultBehavior;
use crate::fq_std::{FQAny, FQClone, FQDefault, FQOption};
-use crate::utility::ident_or_index;
+use crate::utility::{extend_where_clause, ident_or_index, WhereClauseOptions};
use crate::{ReflectMeta, ReflectStruct};
use proc_macro::TokenStream;
use proc_macro2::Span;
diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
--- a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
+++ b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
@@ -49,8 +49,20 @@ pub(crate) fn impl_enum(reflect_enum: &ReflectEnum) -> TokenStream {
let (impl_generics, ty_generics, where_clause) =
reflect_enum.meta().generics().split_for_impl();
+
+ // Add FromReflect bound for each active field
+ let where_from_reflect_clause = extend_where_clause(
+ where_clause,
+ &WhereClauseOptions {
+ active_types: reflect_enum.active_types().into_boxed_slice(),
+ ignored_types: reflect_enum.ignored_types().into_boxed_slice(),
+ active_trait_bounds: quote!(#bevy_reflect_path::FromReflect),
+ ignored_trait_bounds: quote!(#FQDefault),
+ },
+ );
+
TokenStream::from(quote! {
- impl #impl_generics #bevy_reflect_path::FromReflect for #type_name #ty_generics #where_clause {
+ impl #impl_generics #bevy_reflect_path::FromReflect for #type_name #ty_generics #where_from_reflect_clause {
fn from_reflect(#ref_value: &dyn #bevy_reflect_path::Reflect) -> #FQOption<Self> {
if let #bevy_reflect_path::ReflectRef::Enum(#ref_value) = #bevy_reflect_path::Reflect::reflect_ref(#ref_value) {
match #bevy_reflect_path::Enum::variant_name(#ref_value) {
diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
--- a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
+++ b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
@@ -89,11 +101,11 @@ fn impl_struct_internal(reflect_struct: &ReflectStruct, is_tuple: bool) -> Token
Ident::new("Struct", Span::call_site())
};
- let field_types = reflect_struct.active_types();
let MemberValuePair(active_members, active_values) =
get_active_fields(reflect_struct, &ref_struct, &ref_struct_type, is_tuple);
- let constructor = if reflect_struct.meta().traits().contains(REFLECT_DEFAULT) {
+ let is_defaultable = reflect_struct.meta().traits().contains(REFLECT_DEFAULT);
+ let constructor = if is_defaultable {
quote!(
let mut __this: Self = #FQDefault::default();
#(
diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
--- a/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
+++ b/crates/bevy_reflect/bevy_reflect_derive/src/from_reflect.rs
@@ -120,16 +132,19 @@ fn impl_struct_internal(reflect_struct: &ReflectStruct, is_tuple: bool) -> Token
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
// Add FromReflect bound for each active field
- let mut where_from_reflect_clause = if where_clause.is_some() {
- quote! {#where_clause}
- } else if !active_members.is_empty() {
- quote! {where}
- } else {
- quote! {}
- };
- where_from_reflect_clause.extend(quote! {
- #(#field_types: #bevy_reflect_path::FromReflect,)*
- });
+ let where_from_reflect_clause = extend_where_clause(
+ where_clause,
+ &WhereClauseOptions {
+ active_types: reflect_struct.active_types().into_boxed_slice(),
+ ignored_types: reflect_struct.ignored_types().into_boxed_slice(),
+ active_trait_bounds: quote!(#bevy_reflect_path::FromReflect),
+ ignored_trait_bounds: if is_defaultable {
+ quote!()
+ } else {
+ quote!(#FQDefault)
+ },
+ },
+ );
TokenStream::from(quote! {
impl #impl_generics #bevy_reflect_path::FromReflect for #struct_name #ty_generics #where_from_reflect_clause
diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs b/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs
--- a/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs
+++ b/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs
@@ -122,8 +122,9 @@ pub(crate) fn extend_where_clause(
let active_trait_bounds = &where_clause_options.active_trait_bounds;
let ignored_trait_bounds = &where_clause_options.ignored_trait_bounds;
- let mut generic_where_clause = if where_clause.is_some() {
- quote! {#where_clause}
+ let mut generic_where_clause = if let Some(where_clause) = where_clause {
+ let predicates = where_clause.predicates.iter();
+ quote! {where #(#predicates,)*}
} else if !(active_types.is_empty() && ignored_types.is_empty()) {
quote! {where}
} else {
|
diff --git /dev/null b/crates/bevy_reflect_compile_fail_tests/tests/reflect_derive/bounds.pass.rs
new file mode 100644
--- /dev/null
+++ b/crates/bevy_reflect_compile_fail_tests/tests/reflect_derive/bounds.pass.rs
@@ -0,0 +1,282 @@
+use bevy_reflect::prelude::*;
+
+fn main() {}
+
+#[derive(Default)]
+struct NonReflect;
+
+struct NonReflectNonDefault;
+
+mod structs {
+ use super::*;
+
+ #[derive(Reflect)]
+ struct ReflectGeneric<T> {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ struct FromReflectGeneric<T> {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ struct DefaultGeneric<T> {
+ foo: Option<T>,
+ #[reflect(ignore)]
+ _ignored: NonReflectNonDefault,
+ }
+
+ impl<T> Default for DefaultGeneric<T> {
+ fn default() -> Self {
+ Self {
+ foo: None,
+ _ignored: NonReflectNonDefault,
+ }
+ }
+ }
+
+ #[derive(Reflect)]
+ struct ReflectBoundGeneric<T: Clone> {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ struct FromReflectBoundGeneric<T: Clone> {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ struct DefaultBoundGeneric<T: Clone> {
+ foo: Option<T>,
+ #[reflect(ignore)]
+ _ignored: NonReflectNonDefault,
+ }
+
+ impl<T: Clone> Default for DefaultBoundGeneric<T> {
+ fn default() -> Self {
+ Self {
+ foo: None,
+ _ignored: NonReflectNonDefault,
+ }
+ }
+ }
+
+ #[derive(Reflect)]
+ struct ReflectGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ struct FromReflectGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ struct DefaultGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ foo: Option<T>,
+ #[reflect(ignore)]
+ _ignored: NonReflectNonDefault,
+ }
+
+ impl<T> Default for DefaultGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ fn default() -> Self {
+ Self {
+ foo: None,
+ _ignored: NonReflectNonDefault,
+ }
+ }
+ }
+
+ #[derive(Reflect)]
+ #[rustfmt::skip]
+ struct ReflectGenericWithWhereNoTrailingComma<T>
+ where
+ T: Clone
+ {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ #[rustfmt::skip]
+ struct FromReflectGenericWithWhereNoTrailingComma<T>
+ where
+ T: Clone
+ {
+ foo: T,
+ #[reflect(ignore)]
+ _ignored: NonReflect,
+ }
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ #[rustfmt::skip]
+ struct DefaultGenericWithWhereNoTrailingComma<T>
+ where
+ T: Clone
+ {
+ foo: Option<T>,
+ #[reflect(ignore)]
+ _ignored: NonReflectNonDefault,
+ }
+
+ impl<T> Default for DefaultGenericWithWhereNoTrailingComma<T>
+ where
+ T: Clone,
+ {
+ fn default() -> Self {
+ Self {
+ foo: None,
+ _ignored: NonReflectNonDefault,
+ }
+ }
+ }
+}
+
+mod tuple_structs {
+ use super::*;
+
+ #[derive(Reflect)]
+ struct ReflectGeneric<T>(T, #[reflect(ignore)] NonReflect);
+
+ #[derive(Reflect, FromReflect)]
+ struct FromReflectGeneric<T>(T, #[reflect(ignore)] NonReflect);
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ struct DefaultGeneric<T>(Option<T>, #[reflect(ignore)] NonReflectNonDefault);
+
+ impl<T> Default for DefaultGeneric<T> {
+ fn default() -> Self {
+ Self(None, NonReflectNonDefault)
+ }
+ }
+
+ #[derive(Reflect)]
+ struct ReflectBoundGeneric<T: Clone>(T, #[reflect(ignore)] NonReflect);
+
+ #[derive(Reflect, FromReflect)]
+ struct FromReflectBoundGeneric<T: Clone>(T, #[reflect(ignore)] NonReflect);
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ struct DefaultBoundGeneric<T: Clone>(Option<T>, #[reflect(ignore)] NonReflectNonDefault);
+
+ impl<T: Clone> Default for DefaultBoundGeneric<T> {
+ fn default() -> Self {
+ Self(None, NonReflectNonDefault)
+ }
+ }
+
+ #[derive(Reflect)]
+ struct ReflectGenericWithWhere<T>(T, #[reflect(ignore)] NonReflect)
+ where
+ T: Clone;
+
+ #[derive(Reflect, FromReflect)]
+ struct FromReflectGenericWithWhere<T>(T, #[reflect(ignore)] NonReflect)
+ where
+ T: Clone;
+
+ #[derive(Reflect, FromReflect)]
+ #[reflect(Default)]
+ struct DefaultGenericWithWhere<T>(Option<T>, #[reflect(ignore)] NonReflectNonDefault)
+ where
+ T: Clone;
+
+ impl<T> Default for DefaultGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ fn default() -> Self {
+ Self(None, NonReflectNonDefault)
+ }
+ }
+}
+
+mod enums {
+ use super::*;
+
+ #[derive(Reflect)]
+ enum ReflectGeneric<T> {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect, FromReflect)]
+ enum FromReflectGeneric<T> {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect)]
+ enum ReflectBoundGeneric<T: Clone> {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect, FromReflect)]
+ enum FromReflectBoundGeneric<T: Clone> {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect)]
+ enum ReflectGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect, FromReflect)]
+ enum FromReflectGenericWithWhere<T>
+ where
+ T: Clone,
+ {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect)]
+ #[rustfmt::skip]
+ enum ReflectGenericWithWhereNoTrailingComma<T>
+ where
+ T: Clone
+ {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+
+ #[derive(Reflect, FromReflect)]
+ #[rustfmt::skip]
+ enum FromReflectGenericWithWhereNoTrailingComma<T>
+ where
+ T: Clone
+ {
+ Foo(T, #[reflect(ignore)] NonReflect),
+ }
+}
|
Issue with specific reflect breaking after upgrading from 0.9-0.10
## Bevy 0.10
0.10
## What you did
Upgraded from bevy 0.9 -> 0.10
## What went wrong
The following code has stopped compiling:
```rust
use bevy::{reflect::Reflect, utils::HashSet};
#[derive(Default, Clone, Reflect, serde::Serialize, serde::Deserialize)]
pub struct NetSet<T> where T: 'static + Send + Sync + Eq + Copy + core::hash::Hash {
set: HashSet<T>
}
```
There's an error for the reflect derive,
```
Proc-macro derive produced unparseable tokens
```
and one for the HashSet
```
expected one of `(`, `+`, `,`, `::`, `<`, or `{`, found `HashSet`
unexpected token ...
```
## Additional information
Full 0.9 version: <https://github.com/CoffeeVampir3/rusty_cg/blob/main/src/structures/netset.rs>


Fully expanded proc macro:
```rust
// Recursive expansion of Reflect! macro
// ======================================
#[allow(unused_mut)]
impl <T>bevy::reflect::GetTypeRegistration for NetSet<T>where T:'static+Send+Sync+Eq+Copy+core::hash::Hash HashSet<T> :bevy::reflect::Reflect,{
fn get_type_registration() -> bevy::reflect::TypeRegistration {
let mut registration = bevy::reflect::TypeRegistration::of:: <NetSet<T> >();
registration.insert:: <bevy::reflect::ReflectFromPtr>(bevy::reflect::FromType:: <NetSet<T> > ::from_type());
let ignored_indices = ::core::iter::IntoIterator::into_iter([]);
registration.insert:: <bevy::reflect::serde::SerializationData>(bevy::reflect::serde::SerializationData::new(ignored_indices));
registration
}
}
impl <T>bevy::reflect::Typed for NetSet<T>where T:'static+Send+Sync+Eq+Copy+core::hash::Hash HashSet<T> :bevy::reflect::Reflect,{
fn type_info() -> &'static bevy::reflect::TypeInfo {
static CELL:bevy::reflect::utility::GenericTypeInfoCell = bevy::reflect::utility::GenericTypeInfoCell::new();
CELL.get_or_insert:: <Self,_>(||{
let fields = [bevy::reflect::NamedField::new:: <HashSet<T> >("set"),];
let info = bevy::reflect::StructInfo::new:: <Self>("NetSet", &fields);
bevy::reflect::TypeInfo::Struct(info)
})
}
}
impl <T>bevy::reflect::Struct for NetSet<T>where T:'static+Send+Sync+Eq+Copy+core::hash::Hash HashSet<T> :bevy::reflect::Reflect,{
fn field(&self,name: &str) -> ::core::option::Option< &dyn bevy::reflect::Reflect>{
match name {
"set" => ::core::option::Option::Some(&self.set),
_ => ::core::option::Option::None,
}
}
fn field_mut(&mut self,name: &str) -> ::core::option::Option< &mut dyn bevy::reflect::Reflect>{
match name {
"set" => ::core::option::Option::Some(&mut self.set),
_ => ::core::option::Option::None,
}
}
fn field_at(&self,index:usize) -> ::core::option::Option< &dyn bevy::reflect::Reflect>{
match index {
0usize => ::core::option::Option::Some(&self.set),
_ => ::core::option::Option::None,
}
}
fn field_at_mut(&mut self,index:usize) -> ::core::option::Option< &mut dyn bevy::reflect::Reflect>{
match index {
0usize => ::core::option::Option::Some(&mut self.set),
_ => ::core::option::Option::None,
}
}
fn name_at(&self,index:usize) -> ::core::option::Option< &str>{
match index {
0usize => ::core::option::Option::Some("set"),
_ => ::core::option::Option::None,
}
}
fn field_len(&self) -> usize {
1usize
}
fn iter_fields(&self) -> bevy::reflect::FieldIter {
bevy::reflect::FieldIter::new(self)
}
fn clone_dynamic(&self) -> bevy::reflect::DynamicStruct {
let mut dynamic:bevy::reflect::DynamicStruct = ::core::default::Default::default();
dynamic.set_name(::std::string::ToString::to_string(bevy::reflect::Reflect::type_name(self)));
dynamic.insert_boxed("set",bevy::reflect::Reflect::clone_value(&self.set));
dynamic
}
}
impl <T>bevy::reflect::Reflect for NetSet<T>where T:'static+Send+Sync+Eq+Copy+core::hash::Hash HashSet<T> :bevy::reflect::Reflect,{
#[inline]
fn type_name(&self) -> &str {
::core::any::type_name:: <Self>()
}
#[inline]
fn get_type_info(&self) -> &'static bevy::reflect::TypeInfo {
<Self as bevy::reflect::Typed> ::type_info()
}
#[inline]
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn ::core::any::Any>{
self
}
#[inline]
fn as_any(&self) -> &dyn ::core::any::Any {
self
}
#[inline]
fn as_any_mut(&mut self) -> &mut dyn ::core::any::Any {
self
}
#[inline]
fn into_reflect(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn bevy::reflect::Reflect>{
self
}
#[inline]
fn as_reflect(&self) -> &dyn bevy::reflect::Reflect {
self
}
#[inline]
fn as_reflect_mut(&mut self) -> &mut dyn bevy::reflect::Reflect {
self
}
#[inline]
fn clone_value(&self) -> ::std::boxed::Box<dyn bevy::reflect::Reflect>{
::std::boxed::Box::new(bevy::reflect::Struct::clone_dynamic(self))
}
#[inline]
fn set(&mut self,value: ::std::boxed::Box<dyn bevy::reflect::Reflect>) -> ::core::result::Result<(), ::std::boxed::Box<dyn bevy::reflect::Reflect>>{
*self = <dyn bevy::reflect::Reflect> ::take(value)? ;
::core::result::Result::Ok(())
}
#[inline]
fn apply(&mut self,value: &dyn bevy::reflect::Reflect){
if let bevy::reflect::ReflectRef::Struct(struct_value) = bevy::reflect::Reflect::reflect_ref(value){
for(i,value)in::core::iter::Iterator::enumerate(bevy::reflect::Struct::iter_fields(struct_value)){
let name = bevy::reflect::Struct::name_at(struct_value,i).unwrap();
bevy::reflect::Struct::field_mut(self,name).map(|v|v.apply(value));
}
}else {
panic!("Attempted to apply non-struct type to struct type.");
}
}
fn reflect_ref(&self) -> bevy::reflect::ReflectRef {
bevy::reflect::ReflectRef::Struct(self)
}
fn reflect_mut(&mut self) -> bevy::reflect::ReflectMut {
bevy::reflect::ReflectMut::Struct(self)
}
fn reflect_owned(self: ::std::boxed::Box<Self>) -> bevy::reflect::ReflectOwned {
bevy::reflect::ReflectOwned::Struct(self)
}
fn reflect_partial_eq(&self,value: &dyn bevy::reflect::Reflect) -> ::core::option::Option<bool>{
bevy::reflect::struct_partial_eq(self,value)
}
}
```
|
After expanding the macro I think I've found the issue:
The emitted version of the macro (one example)
```rust
#[allow(unused_mut)]
impl <T>bevy::reflect::GetTypeRegistration for NetSet<T>where T:'static+Send+Sync+Eq+Copy+core::hash::Hash HashSet<T> :bevy::reflect::Reflect,{
fn get_type_registration() -> bevy::reflect::TypeRegistration {
let mut registration = bevy::reflect::TypeRegistration::of:: <NetSet<T> >();
registration.insert:: <bevy::reflect::ReflectFromPtr>(bevy::reflect::FromType:: <NetSet<T> > ::from_type());
let ignored_indices = ::core::iter::IntoIterator::into_iter([]);
registration.insert:: <bevy::reflect::serde::SerializationData>(bevy::reflect::serde::SerializationData::new(ignored_indices));
registration
}
```
there's a missing comma on the reflect emit it appears. gunna dig into the reflect proc macro and see if I can get it to work.
|
2023-03-10T06:47:15Z
|
1.67
|
2023-03-27T22:06:30Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"tests/reflect_derive/bounds.pass.rs [should pass]",
"test"
] |
[
"tests/reflect_derive/generics.fail.rs [should fail to compile]",
"tests/reflect_derive/generics_structs.pass.rs [should pass]",
"tests/reflect_derive/lifetimes.pass.rs [should pass]"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 8,012
|
bevyengine__bevy-8012
|
[
"8010"
] |
2d5ef75c9fc93cbb301c4b0d19f73b8864694be9
|
diff --git a/crates/bevy_ecs/macros/src/fetch.rs b/crates/bevy_ecs/macros/src/fetch.rs
--- a/crates/bevy_ecs/macros/src/fetch.rs
+++ b/crates/bevy_ecs/macros/src/fetch.rs
@@ -1,9 +1,10 @@
+use bevy_macro_utils::ensure_no_collision;
use proc_macro::TokenStream;
use proc_macro2::{Ident, Span};
use quote::{quote, ToTokens};
use syn::{
parse::{Parse, ParseStream},
- parse_quote,
+ parse_macro_input, parse_quote,
punctuated::Punctuated,
Attribute, Data, DataStruct, DeriveInput, Field, Fields,
};
diff --git a/crates/bevy_ecs/macros/src/fetch.rs b/crates/bevy_ecs/macros/src/fetch.rs
--- a/crates/bevy_ecs/macros/src/fetch.rs
+++ b/crates/bevy_ecs/macros/src/fetch.rs
@@ -25,7 +26,10 @@ mod field_attr_keywords {
pub static WORLD_QUERY_ATTRIBUTE_NAME: &str = "world_query";
-pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
+pub fn derive_world_query_impl(input: TokenStream) -> TokenStream {
+ let tokens = input.clone();
+
+ let ast = parse_macro_input!(input as DeriveInput);
let visibility = ast.vis;
let mut fetch_struct_attributes = FetchStructAttributes::default();
diff --git a/crates/bevy_ecs/macros/src/fetch.rs b/crates/bevy_ecs/macros/src/fetch.rs
--- a/crates/bevy_ecs/macros/src/fetch.rs
+++ b/crates/bevy_ecs/macros/src/fetch.rs
@@ -104,13 +108,18 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
};
let fetch_struct_name = Ident::new(&format!("{struct_name}Fetch"), Span::call_site());
+ let fetch_struct_name = ensure_no_collision(fetch_struct_name, tokens.clone());
let read_only_fetch_struct_name = if fetch_struct_attributes.is_mutable {
- Ident::new(&format!("{struct_name}ReadOnlyFetch"), Span::call_site())
+ let new_ident = Ident::new(&format!("{struct_name}ReadOnlyFetch"), Span::call_site());
+ ensure_no_collision(new_ident, tokens.clone())
} else {
fetch_struct_name.clone()
};
+ // Generate a name for the state struct that doesn't conflict
+ // with the struct definition.
let state_struct_name = Ident::new(&format!("{struct_name}State"), Span::call_site());
+ let state_struct_name = ensure_no_collision(state_struct_name, tokens);
let fields = match &ast.data {
Data::Struct(DataStruct {
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -6,7 +6,9 @@ mod set;
mod states;
use crate::{fetch::derive_world_query_impl, set::derive_set};
-use bevy_macro_utils::{derive_boxed_label, get_named_struct_fields, BevyManifest};
+use bevy_macro_utils::{
+ derive_boxed_label, ensure_no_collision, get_named_struct_fields, BevyManifest,
+};
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::{format_ident, quote};
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -260,6 +262,7 @@ static SYSTEM_PARAM_ATTRIBUTE_NAME: &str = "system_param";
/// Implement `SystemParam` to use a struct as a parameter in a system
#[proc_macro_derive(SystemParam, attributes(system_param))]
pub fn derive_system_param(input: TokenStream) -> TokenStream {
+ let token_stream = input.clone();
let ast = parse_macro_input!(input as DeriveInput);
let syn::Data::Struct(syn::DataStruct { fields: field_definitions, ..}) = ast.data else {
return syn::Error::new(ast.span(), "Invalid `SystemParam` type: expected a `struct`")
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -394,6 +397,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
let struct_name = &ast.ident;
let state_struct_visibility = &ast.vis;
+ let state_struct_name = ensure_no_collision(format_ident!("FetchState"), token_stream);
TokenStream::from(quote! {
// We define the FetchState struct in an anonymous scope to avoid polluting the user namespace.
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -401,7 +405,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
// <EventReader<'static, 'static, T> as SystemParam>::State
const _: () = {
#[doc(hidden)]
- #state_struct_visibility struct FetchState <'w, 's, #(#lifetimeless_generics,)*>
+ #state_struct_visibility struct #state_struct_name <'w, 's, #(#lifetimeless_generics,)*>
#where_clause {
state: (#(<#tuple_types as #path::system::SystemParam>::State,)*),
marker: std::marker::PhantomData<(
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -411,11 +415,11 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
}
unsafe impl<'w, 's, #punctuated_generics> #path::system::SystemParam for #struct_name #ty_generics #where_clause {
- type State = FetchState<'static, 'static, #punctuated_generic_idents>;
+ type State = #state_struct_name<'static, 'static, #punctuated_generic_idents>;
type Item<'_w, '_s> = #struct_name <#(#shadowed_lifetimes,)* #punctuated_generic_idents>;
fn init_state(world: &mut #path::world::World, system_meta: &mut #path::system::SystemMeta) -> Self::State {
- FetchState {
+ #state_struct_name {
state: <(#(#tuple_types,)*) as #path::system::SystemParam>::init_state(world, system_meta),
marker: std::marker::PhantomData,
}
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -454,8 +458,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
/// Implement `WorldQuery` to use a struct as a parameter in a query
#[proc_macro_derive(WorldQuery, attributes(world_query))]
pub fn derive_world_query(input: TokenStream) -> TokenStream {
- let ast = parse_macro_input!(input as DeriveInput);
- derive_world_query_impl(ast)
+ derive_world_query_impl(input)
}
/// Derive macro generating an impl of the trait `ScheduleLabel`.
diff --git a/crates/bevy_macro_utils/Cargo.toml b/crates/bevy_macro_utils/Cargo.toml
--- a/crates/bevy_macro_utils/Cargo.toml
+++ b/crates/bevy_macro_utils/Cargo.toml
@@ -12,3 +12,4 @@ keywords = ["bevy"]
toml_edit = "0.19"
syn = "1.0"
quote = "1.0"
+rustc-hash = "1.0"
diff --git a/crates/bevy_macro_utils/src/lib.rs b/crates/bevy_macro_utils/src/lib.rs
--- a/crates/bevy_macro_utils/src/lib.rs
+++ b/crates/bevy_macro_utils/src/lib.rs
@@ -8,10 +8,11 @@ pub use attrs::*;
pub use shape::*;
pub use symbol::*;
-use proc_macro::TokenStream;
+use proc_macro::{TokenStream, TokenTree};
use quote::{quote, quote_spanned};
+use rustc_hash::FxHashSet;
use std::{env, path::PathBuf};
-use syn::spanned::Spanned;
+use syn::{spanned::Spanned, Ident};
use toml_edit::{Document, Item};
pub struct BevyManifest {
diff --git a/crates/bevy_macro_utils/src/lib.rs b/crates/bevy_macro_utils/src/lib.rs
--- a/crates/bevy_macro_utils/src/lib.rs
+++ b/crates/bevy_macro_utils/src/lib.rs
@@ -108,6 +109,48 @@ impl BevyManifest {
}
}
+/// Finds an identifier that will not conflict with the specified set of tokens.
+/// If the identifier is present in `haystack`, extra characters will be added
+/// to it until it no longer conflicts with anything.
+///
+/// Note that the returned identifier can still conflict in niche cases,
+/// such as if an identifier in `haystack` is hidden behind an un-expanded macro.
+pub fn ensure_no_collision(value: Ident, haystack: TokenStream) -> Ident {
+ // Collect all the identifiers in `haystack` into a set.
+ let idents = {
+ // List of token streams that will be visited in future loop iterations.
+ let mut unvisited = vec![haystack];
+ // Identifiers we have found while searching tokens.
+ let mut found = FxHashSet::default();
+ while let Some(tokens) = unvisited.pop() {
+ for t in tokens {
+ match t {
+ // Collect any identifiers we encounter.
+ TokenTree::Ident(ident) => {
+ found.insert(ident.to_string());
+ }
+ // Queue up nested token streams to be visited in a future loop iteration.
+ TokenTree::Group(g) => unvisited.push(g.stream()),
+ TokenTree::Punct(_) | TokenTree::Literal(_) => {}
+ }
+ }
+ }
+
+ found
+ };
+
+ let span = value.span();
+
+ // If there's a collision, add more characters to the identifier
+ // until it doesn't collide with anything anymore.
+ let mut value = value.to_string();
+ while idents.contains(&value) {
+ value.push('X');
+ }
+
+ Ident::new(&value, span)
+}
+
/// Derive a label trait
///
/// # Args
|
diff --git a/crates/bevy_ecs/src/query/fetch.rs b/crates/bevy_ecs/src/query/fetch.rs
--- a/crates/bevy_ecs/src/query/fetch.rs
+++ b/crates/bevy_ecs/src/query/fetch.rs
@@ -1388,3 +1388,37 @@ unsafe impl<Q: WorldQuery> WorldQuery for NopWorldQuery<Q> {
/// SAFETY: `NopFetch` never accesses any data
unsafe impl<Q: WorldQuery> ReadOnlyWorldQuery for NopWorldQuery<Q> {}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use crate::{self as bevy_ecs, system::Query};
+
+ // Ensures that metadata types generated by the WorldQuery macro
+ // do not conflict with user-defined types.
+ // Regression test for https://github.com/bevyengine/bevy/issues/8010.
+ #[test]
+ fn world_query_metadata_collision() {
+ // The metadata types generated would be named `ClientState` and `ClientFetch`,
+ // but they should rename themselves to avoid conflicts.
+ #[derive(WorldQuery)]
+ pub struct Client<S: ClientState> {
+ pub state: &'static S,
+ pub fetch: &'static ClientFetch,
+ }
+
+ pub trait ClientState: Component {}
+
+ #[derive(Component)]
+ pub struct ClientFetch;
+
+ #[derive(Component)]
+ pub struct C;
+
+ impl ClientState for C {}
+
+ fn client_system(_: Query<Client<C>>) {}
+
+ crate::system::assert_is_system(client_system);
+ }
+}
diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs
--- a/crates/bevy_ecs/src/system/system_param.rs
+++ b/crates/bevy_ecs/src/system/system_param.rs
@@ -1625,7 +1625,7 @@ mod tests {
#[derive(SystemParam)]
pub struct EncapsulatedParam<'w>(Res<'w, PrivateResource>);
- // regression test for https://github.com/bevyengine/bevy/issues/7103.
+ // Regression test for https://github.com/bevyengine/bevy/issues/7103.
#[derive(SystemParam)]
pub struct WhereParam<'w, 's, Q>
where
diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs
--- a/crates/bevy_ecs/src/system/system_param.rs
+++ b/crates/bevy_ecs/src/system/system_param.rs
@@ -1633,4 +1633,13 @@ mod tests {
{
_q: Query<'w, 's, Q, ()>,
}
+
+ // Regression test for https://github.com/bevyengine/bevy/issues/1727.
+ #[derive(SystemParam)]
+ pub struct Collide<'w> {
+ _x: Res<'w, FetchState>,
+ }
+
+ #[derive(Resource)]
+ pub struct FetchState;
}
|
WorldQuery derive State and Fetch types are still accidentally nameable
## Bevy version
Latest commit as of writing ([`7d9cb1c`](https://github.com/bevyengine/bevy/commit/7d9cb1c4ab210595c5228af0ed4ec7d095241db5))
## What you did
```rust
#[derive(WorldQuery)]
pub struct Client<S: ClientState> {
pub state: &'static S,
// ...
}
pub trait ClientState: Component {}
```
## What went wrong
```rust
error[E0404]: expected trait, found struct `ClientState`
--> crates/example/src/client.rs:11:22
|
11 | pub struct Client<S: ClientState> {
| ^^^^^^^^^^^ not a trait
...
35 | pub trait ClientState: Component {
| ----------- you might have meant to refer to this trait
|
help: consider importing this trait instead
|
1 | use crate::client::ClientState;
|
```
## Additional information
To workaround it currently, we can prepend `self::` to the struct bound:
```rust
#[derive(WorldQuery)]
pub struct Client<S: self::ClientState> {
pub state: &'static S,
// ...
}
```
|
Interesting, I'll look into this. Not sure if there's a clean way of solving this, but it should at least be possible to *check* for this footgun and emit a descriptive error message.
|
2023-03-10T04:12:11Z
|
1.67
|
2023-03-22T16:42:32Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::mut_new",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_const",
"change_detection::tests::set_if_neq",
"entity::tests::reserve_entity_len",
"entity::tests::get_reserved_and_invalid",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::change_expiration",
"change_detection::tests::change_tick_scan",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_len_updated",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_extend_impl",
"event::tests::test_firing_empty_event",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend",
"query::access::tests::filtered_combined_access",
"query::access::tests::read_all_access_conflicts",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::tests::any_query",
"query::tests::many_entities",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::multi_storage_query",
"query::tests::query",
"query::tests::derived_worldqueries",
"query::tests::query_iter_combinations_sparse",
"query::tests::query_iter_combinations",
"query::tests::query_filtered_iter_combinations",
"query::tests::self_conflicting_worldquery - should panic",
"schedule::condition::tests::distributive_run_if_compiles",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::dependency_cycle",
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"storage::sparse_set::tests::sparse_set",
"system::commands::command_queue::test::test_command_is_send",
"storage::sparse_set::tests::sparse_sets",
"system::commands::command_queue::test::test_command_queue_inner_drop",
"storage::blob_vec::tests::aligned_zst",
"storage::table::tests::table",
"system::commands::command_queue::test::test_command_queue_inner",
"system::commands::command_queue::test::test_command_queue_inner_panic_safe",
"storage::blob_vec::tests::resize_test",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"system::commands::tests::remove_resources",
"system::system_piping::adapter::assert_systems",
"system::commands::tests::commands",
"system::commands::tests::remove_components",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::get_system_conflicts",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::immutable_mut_test",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::convert_mut_to_immut",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::can_have_16_parameters",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::query_is_empty",
"system::tests::long_life_test",
"system::tests::query_validates_world_id - should panic",
"system::tests::read_system_state",
"system::tests::system_state_archetype_update",
"system::tests::simple_system",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_change_detection",
"system::tests::write_system_state",
"system::tests::update_archetype_component_access_works",
"tests::added_queries",
"tests::added_tracking",
"tests::bundle_derive",
"tests::add_remove_components",
"tests::despawn_mixed_storage",
"tests::duplicate_components_panic - should panic",
"tests::changed_query",
"tests::clear_entities",
"tests::empty_spawn",
"tests::filtered_query_access",
"tests::despawn_table_storage",
"tests::insert_or_spawn_batch",
"tests::insert_or_spawn_batch_invalid",
"tests::changed_trackers_sparse",
"tests::insert_overwrite_drop",
"tests::insert_overwrite_drop_sparse",
"tests::changed_trackers",
"tests::exact_size_query",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::non_send_resource",
"tests::non_send_resource_drop_from_same_thread",
"tests::mut_and_ref_query_panic - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::non_send_resource_points_to_distinct_data",
"system::tests::non_send_system",
"system::tests::non_send_option_system",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::readonly_query_get_mut_component_fails",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"tests::query_all",
"event::tests::test_event_iter_nth",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::tests::conditions::systems_nested_in_system_sets",
"system::tests::query_system_gets",
"system::tests::query_set_system",
"tests::query_filter_with_for_each",
"tests::query_filter_with",
"tests::query_filter_with_sparse",
"system::tests::nonconflicting_system_resources",
"schedule::tests::conditions::system_with_condition",
"system::tests::local_system",
"system::tests::disjoint_query_mut_system",
"tests::query_filter_with_sparse_for_each",
"system::tests::world_collections_system",
"system::tests::panic_inside_system - should panic",
"system::tests::into_iter_impl",
"schedule::tests::conditions::systems_with_distributive_condition",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"schedule::tests::system_ordering::order_exclusive_systems",
"schedule::condition::tests::multiple_run_conditions",
"schedule::tests::conditions::system_conditions_and_change_detection",
"tests::query_all_for_each",
"tests::query_filter_without",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"system::tests::or_param_set_system",
"system::tests::any_of_has_filter_with_when_both_have_it",
"schedule::tests::system_execution::run_system",
"schedule::tests::system_execution::run_exclusive_system",
"system::tests::disjoint_query_mut_read_component_system",
"schedule::tests::conditions::multiple_conditions_on_system",
"tests::query_optional_component_sparse_no_match",
"tests::query_single_component",
"system::tests::changed_resource_system",
"tests::query_optional_component_table",
"tests::query_single_component_for_each",
"tests::query_filters_dont_collide_with_fetches",
"schedule::condition::tests::run_condition_combinators",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"system::tests::commands_param_set",
"system::tests::removal_tracking",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::tests::system_ordering::add_systems_correct_order",
"tests::remove_missing",
"tests::reserve_and_spawn",
"tests::resource",
"tests::resource_scope",
"tests::query_get",
"tests::reserve_entities_across_worlds",
"tests::query_missing_component",
"tests::spawn_batch",
"schedule::condition::tests::run_condition",
"tests::query_optional_component_sparse",
"tests::query_sparse_component",
"tests::sparse_set_add_remove_many",
"tests::ref_and_mut_query_panic - should panic",
"tests::remove_tracking",
"tests::take",
"tests::remove",
"tests::par_for_each_sparse",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"tests::random_access",
"tests::query_get_works_across_sparse_removal",
"tests::stateful_query_handles_new_archetype",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"tests::par_for_each_dense",
"tests::non_send_resource_panic - should panic",
"tests::non_send_resource_drop_from_different_thread - should panic",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_ref_get_by_id",
"schedule::tests::system_ordering::order_systems",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::identifier::tests::world_ids_unique",
"world::tests::custom_resource_with_layout",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::tests::get_resource_mut_by_id",
"world::tests::get_resource_by_id",
"world::tests::init_resource_does_not_overwrite",
"world::tests::init_non_send_resource_does_not_overwrite",
"query::tests::par_iter_mut_change_detection",
"world::world_cell::tests::world_access_reused",
"world::tests::panic_while_overwriting_component",
"world::world_cell::tests::world_cell",
"world::world_cell::tests::world_cell_double_mut - should panic",
"world::tests::spawn_empty_bundle",
"world::world_cell::tests::world_cell_ref_and_ref",
"world::world_cell::tests::world_cell_ref_and_mut - should panic",
"world::world_cell::tests::world_cell_mut_and_ref - should panic",
"world::tests::iterate_entities",
"world::tests::inspect_entity_components",
"query::tests::query_filtered_exactsizeiterator_len",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"src/component.rs - component::Component (line 124) - compile fail",
"src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 143) - compile",
"src/query/fetch.rs - query::fetch::WorldQuery (line 108) - compile fail",
"src/component.rs - component::ComponentTicks::set_changed (line 711) - compile",
"src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 153) - compile",
"src/component.rs - component::ComponentIdFor (line 727)",
"src/change_detection.rs - change_detection::DetectChangesMut (line 77)",
"src/change_detection.rs - change_detection::Mut<'a,T>::map_unchanged (line 612)",
"src/change_detection.rs - change_detection::DetectChanges (line 33)",
"src/component.rs - component::Component (line 99)",
"src/component.rs - component::Component (line 34)",
"src/query/iter.rs - query::iter::QueryCombinationIter (line 241)",
"src/lib.rs - (line 189)",
"src/removal_detection.rs - removal_detection::RemovedComponents (line 119)",
"src/bundle.rs - bundle::Bundle (line 93)",
"src/lib.rs - (line 287)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 199)",
"src/change_detection.rs - change_detection::ResMut<'a,T>::map_unchanged (line 461)",
"src/system/commands/mod.rs - system::commands::Command (line 24)",
"src/event.rs - event::EventWriter (line 257)",
"src/entity/mod.rs - entity::Entity (line 77)",
"src/component.rs - component::StorageType (line 178)",
"src/event.rs - event::EventWriter (line 274)",
"src/component.rs - component::Component (line 134)",
"src/change_detection.rs - change_detection::NonSendMut<'a,T>::map_unchanged (line 494)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 124)",
"src/query/iter.rs - query::iter::QueryCombinationIter (line 255)",
"src/lib.rs - (line 212)",
"src/query/filter.rs - query::filter::Without (line 120)",
"src/lib.rs - (line 165)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 67)",
"src/query/filter.rs - query::filter::Added (line 566)",
"src/entity/map_entities.rs - entity::map_entities::MapEntities (line 34)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 144)",
"src/query/filter.rs - query::filter::Changed (line 602)",
"src/lib.rs - (line 30)",
"src/query/filter.rs - query::filter::With (line 24)",
"src/entity/mod.rs - entity::Entity (line 97)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 224)",
"src/lib.rs - (line 74)",
"src/system/commands/mod.rs - system::commands::Commands (line 70)",
"src/query/filter.rs - query::filter::Or (line 220)",
"src/lib.rs - (line 239)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 270)",
"src/event.rs - event::EventReader<'w,'s,E>::is_empty (line 217)",
"src/schedule/state.rs - schedule::state::States (line 28)",
"src/system/commands/mod.rs - system::commands::Commands (line 88)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 252)",
"src/component.rs - component::Component (line 80)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 514)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 432)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 315)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::many (line 827) - compile",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::many_mut (line 932) - compile",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 460)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 357)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::id (line 638)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::despawn (line 768)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 487)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 211)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::insert (line 662)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::remove (line 716)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::add (line 793)",
"src/system/query.rs - system::query::Query (line 57)",
"src/system/query.rs - system::query::Query (line 36)",
"src/system/query.rs - system::query::Query (line 113)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 148)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::for_each (line 655)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_mut (line 874)",
"src/system/mod.rs - system (line 13)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::contains (line 1312)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_inner (line 1453)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::for_each_mut (line 693)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::single (line 1147)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_single (line 1175)",
"src/system/query.rs - system::query::Query (line 97)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_many (line 487)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get (line 761)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_component_mut (line 1063)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_component (line 1005)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_combinations_mut (line 453)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter (line 352)",
"src/system/system_param.rs - system::system_param::Resource (line 378) - compile fail",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_mut (line 387)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_single_mut (line 1252)",
"src/system/system_param.rs - system::system_param::StaticSystemParam (line 1459) - compile fail",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::is_empty (line 1288)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_combinations (line 419)",
"src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 24)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_many_mut (line 543)",
"src/system/query.rs - system::query::Query (line 77)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::single_mut (line 1222)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_inner (line 1410)",
"src/system/system_param.rs - system::system_param::Local (line 667)",
"src/system/system_param.rs - system::system_param::ParamSet (line 302)",
"src/system/system_param.rs - system::system_param::ParamSet (line 267)",
"src/system/system_param.rs - system::system_param::Resource (line 389)",
"src/system/system_param.rs - system::system_param::StaticSystemParam (line 1435)",
"src/system/system_param.rs - system::system_param::SystemParam (line 47)",
"src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 45)",
"src/lib.rs - (line 91)",
"src/component.rs - component::Components::component_id (line 493)",
"src/lib.rs - (line 41)",
"src/lib.rs - (line 254)",
"src/component.rs - component::Components::resource_id (line 527)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 235)",
"src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 213)",
"src/schedule/condition.rs - schedule::condition::Condition::and_then (line 44)",
"src/schedule/condition.rs - schedule::condition::common_conditions::in_state (line 653)",
"src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 155)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 551)",
"src/lib.rs - (line 124)",
"src/system/query.rs - system::query::Query (line 162)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 420)",
"src/event.rs - event::Events (line 79)",
"src/schedule/condition.rs - schedule::condition::Condition::and_then (line 25)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 273)",
"src/lib.rs - (line 51)",
"src/schedule/condition.rs - schedule::condition::common_conditions::state_changed (line 771)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 316)",
"src/system/function_system.rs - system::function_system::In (line 346)",
"src/system/function_system.rs - system::function_system::SystemParamFunction (line 565)",
"src/schedule/schedule.rs - schedule::schedule::Schedule (line 121)",
"src/world/mod.rs - world::World::clear_trackers (line 655)",
"src/schedule/condition.rs - schedule::condition::common_conditions::state_exists_and_equals (line 705)",
"src/schedule/schedule.rs - schedule::schedule::Schedule (line 135)",
"src/system/function_system.rs - system::function_system::IntoSystem (line 311)",
"src/schedule/condition.rs - schedule::condition::common_conditions::state_exists (line 606)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 196)",
"src/system/function_system.rs - system::function_system::SystemState (line 115)",
"src/schedule/condition.rs - schedule::condition::common_conditions::not (line 900)",
"src/system/system_piping.rs - system::system_piping::adapter::error (line 250)",
"src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 864)",
"src/world/mod.rs - world::World::entity_mut (line 257)",
"src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 821)",
"src/system/query.rs - system::query::Query (line 139)",
"src/system/function_system.rs - system::function_system::SystemState (line 83)",
"src/system/commands/mod.rs - system::commands::EntityCommand (line 550)",
"src/system/system_piping.rs - system::system_piping::adapter::dbg (line 194)",
"src/query/state.rs - query::state::QueryState<Q,F>::get_many_mut (line 291)",
"src/query/state.rs - query::state::QueryState<Q,F>::get_many (line 231)",
"src/system/system_param.rs - system::system_param::ParamSet (line 238)",
"src/world/mod.rs - world::World::get (line 566)",
"src/system/mod.rs - system (line 56)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 366)",
"src/schedule/condition.rs - schedule::condition::Condition::or_else (line 76)",
"src/world/mod.rs - world::World::spawn_batch (line 540)",
"src/system/system_param.rs - system::system_param::Resource (line 349)",
"src/world/mod.rs - world::World::despawn (line 613)",
"src/world/mod.rs - world::World::resource_scope (line 1272)",
"src/world/mod.rs - world::World::component_id (line 211)",
"src/world/mod.rs - world::World::insert_or_spawn_batch (line 1155)",
"src/system/system_param.rs - system::system_param::Local (line 644)",
"src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 481)",
"src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::world_scope (line 677)",
"src/system/system_piping.rs - system::system_piping::adapter::info (line 167)",
"src/system/combinator.rs - system::combinator::Combine (line 18)",
"src/system/system_piping.rs - system::system_piping::adapter::unwrap (line 136)",
"src/world/mod.rs - world::World::get_mut (line 587)",
"src/world/mod.rs - world::World::spawn (line 441)",
"src/system/system_piping.rs - system::system_piping::adapter::warn (line 221)",
"src/world/mod.rs - world::World::spawn_empty (line 408)",
"src/system/system_piping.rs - system::system_piping::adapter::ignore (line 281)",
"src/system/system_piping.rs - system::system_piping::PipeSystem (line 19)",
"src/system/system_param.rs - system::system_param::Deferred (line 780)",
"src/world/mod.rs - world::World::query (line 685)",
"src/world/mod.rs - world::World::entity (line 232)",
"src/world/mod.rs - world::World::get_entity (line 330)",
"src/world/mod.rs - world::World::get_entity_mut (line 383)",
"src/system/system_piping.rs - system::system_piping::adapter::new (line 108)",
"src/world/mod.rs - world::World::query_filtered (line 752)",
"src/world/mod.rs - world::World::query (line 721)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 7,931
|
bevyengine__bevy-7931
|
[
"6497"
] |
d3df04cb4c8d94cb06780a777cc6712fa4a316dd
|
diff --git a/crates/bevy_ecs/src/change_detection.rs b/crates/bevy_ecs/src/change_detection.rs
--- a/crates/bevy_ecs/src/change_detection.rs
+++ b/crates/bevy_ecs/src/change_detection.rs
@@ -537,6 +537,41 @@ pub struct Mut<'a, T: ?Sized> {
pub(crate) ticks: TicksMut<'a>,
}
+impl<'a, T: ?Sized> Mut<'a, T> {
+ /// Creates a new change-detection enabled smart pointer.
+ /// In almost all cases you do not need to call this method manually,
+ /// as instances of `Mut` will be created by engine-internal code.
+ ///
+ /// Many use-cases of this method would be better served by [`Mut::map_unchanged`]
+ /// or [`Mut::reborrow`].
+ ///
+ /// - `value` - The value wrapped by this smart pointer.
+ /// - `added` - A [`Tick`] that stores the tick when the wrapped value was created.
+ /// - `last_changed` - A [`Tick`] that stores the last time the wrapped value was changed.
+ /// This will be updated to the value of `change_tick` if the returned smart pointer
+ /// is modified.
+ /// - `last_change_tick` - A [`Tick`], occurring before `change_tick`, which is used
+ /// as a reference to determine whether the wrapped value is newly added or changed.
+ /// - `change_tick` - A [`Tick`] corresponding to the current point in time -- "now".
+ pub fn new(
+ value: &'a mut T,
+ added: &'a mut Tick,
+ last_changed: &'a mut Tick,
+ last_change_tick: u32,
+ change_tick: u32,
+ ) -> Self {
+ Self {
+ value,
+ ticks: TicksMut {
+ added,
+ changed: last_changed,
+ last_change_tick,
+ change_tick,
+ },
+ }
+ }
+}
+
impl<'a, T: ?Sized> From<Mut<'a, T>> for Ref<'a, T> {
fn from(mut_ref: Mut<'a, T>) -> Self {
Self {
|
diff --git a/crates/bevy_ecs/src/change_detection.rs b/crates/bevy_ecs/src/change_detection.rs
--- a/crates/bevy_ecs/src/change_detection.rs
+++ b/crates/bevy_ecs/src/change_detection.rs
@@ -827,6 +862,26 @@ mod tests {
assert_eq!(4, into_mut.ticks.change_tick);
}
+ #[test]
+ fn mut_new() {
+ let mut component_ticks = ComponentTicks {
+ added: Tick::new(1),
+ changed: Tick::new(3),
+ };
+ let mut res = R {};
+
+ let val = Mut::new(
+ &mut res,
+ &mut component_ticks.added,
+ &mut component_ticks.changed,
+ 2, // last_change_tick
+ 4, // current change_tick
+ );
+
+ assert!(!val.is_added());
+ assert!(val.is_changed());
+ }
+
#[test]
fn mut_from_non_send_mut() {
let mut component_ticks = ComponentTicks {
|
Expose a public constructor for `Mut`
## What problem does this solve or what need does it fill?
While ordinarily `Mut` should not be constructed directly by users (and instead should be retrieved via querying), it can be very useful when writing bevy-external tests.
## What solution would you like?
Create a `Mut::new(value: T, ticks: Ticks)` method.
Carefully document that this is an advanced API, and explain how to correctly set the `Ticks` value (following the `set_last_changed` API).
## What alternative(s) have you considered?
Users can already construct arbitrary `Mut` values directly, via APIs like `world.get_mut()`. This may involve creating a dummy world, which is wasteful, confusing and roundabout.
## Additional context
Discussed [on Discord](https://discord.com/channels/691052431525675048/749332104487108618/1038856546869850232) in the context of testing asset code with @djeedai, @maniwani and @JoJoJet.
|
2023-03-06T16:52:34Z
|
1.67
|
2023-04-05T14:22:14Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_non_send_mut",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_const",
"change_detection::tests::set_if_neq",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::change_tick_scan",
"change_detection::tests::change_expiration",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_len_updated",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_firing_empty_event",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend",
"query::access::tests::filtered_combined_access",
"query::access::tests::read_all_access_conflicts",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::tests::any_query",
"query::tests::many_entities",
"query::tests::multi_storage_query",
"query::tests::query",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::query_iter_combinations",
"query::tests::query_iter_combinations_sparse",
"query::tests::self_conflicting_worldquery - should panic",
"query::tests::derived_worldqueries",
"schedule::tests::base_sets::disallow_adding_base_sets_to_base_sets - should panic",
"schedule::tests::base_sets::disallow_adding_base_sets_to_sets - should panic",
"query::tests::query_filtered_iter_combinations",
"schedule::tests::base_sets::disallow_adding_set_to_multiple_base_sets - should panic",
"schedule::tests::base_sets::disallow_adding_sets_to_multiple_base_sets - should panic",
"schedule::tests::base_sets::disallow_adding_system_to_multiple_base_sets - should panic",
"schedule::tests::base_sets::disallow_adding_systems_to_multiple_base_sets - should panic",
"schedule::tests::base_sets::allow_same_base_sets",
"schedule::tests::base_sets::disallow_multiple_base_sets",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"storage::blob_vec::tests::aligned_zst",
"system::commands::command_queue::test::test_command_is_send",
"storage::sparse_set::tests::sparse_sets",
"storage::sparse_set::tests::sparse_set",
"system::commands::command_queue::test::test_command_queue_inner",
"system::commands::command_queue::test::test_command_queue_inner_drop",
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::resize_test",
"system::system_piping::adapter::assert_systems",
"system::commands::command_queue::test::test_command_queue_inner_panic_safe",
"storage::table::tests::table",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"system::commands::tests::remove_resources",
"system::commands::tests::remove_components",
"system::commands::tests::commands",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::get_system_conflicts",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::immutable_mut_test",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::convert_mut_to_immut",
"system::tests::long_life_test",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::query_validates_world_id - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::read_system_state",
"system::tests::query_is_empty",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_archetype_update",
"system::tests::simple_system",
"system::tests::write_system_state",
"system::tests::system_state_change_detection",
"tests::add_remove_components",
"system::tests::update_archetype_component_access_works",
"tests::added_queries",
"tests::added_tracking",
"tests::changed_query",
"tests::bundle_derive",
"tests::duplicate_components_panic - should panic",
"tests::filtered_query_access",
"tests::despawn_mixed_storage",
"tests::clear_entities",
"tests::despawn_table_storage",
"tests::changed_trackers",
"tests::empty_spawn",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop",
"tests::exact_size_query",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::insert_or_spawn_batch_invalid",
"tests::changed_trackers_sparse",
"tests::multiple_worlds_same_query_get - should panic",
"tests::insert_overwrite_drop_sparse",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::non_send_resource",
"tests::mut_and_mut_query_panic - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_without",
"tests::non_send_resource_points_to_distinct_data",
"tests::query_missing_component",
"tests::query_get_works_across_sparse_removal",
"system::tests::disjoint_query_mut_read_component_system",
"schedule::tests::system_execution::run_exclusive_system",
"system::tests::non_send_option_system",
"tests::query_all",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::query_filter_with_sparse_for_each",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::local_system",
"tests::query_filter_with",
"event::tests::test_event_iter_nth",
"system::tests::into_iter_impl",
"tests::query_filter_with_for_each",
"system::tests::nonconflicting_system_resources",
"schedule::tests::conditions::system_with_condition",
"system::tests::non_send_system",
"system::tests::query_system_gets",
"system::tests::disjoint_query_mut_system",
"tests::query_filter_with_sparse",
"tests::remove_missing",
"schedule::tests::conditions::systems_nested_in_system_sets",
"tests::ref_and_mut_query_panic - should panic",
"tests::query_optional_component_table",
"schedule::tests::system_execution::run_system",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"tests::stateful_query_handles_new_archetype",
"tests::query_single_component_for_each",
"tests::take",
"schedule::tests::conditions::systems_with_distributive_condition",
"tests::query_sparse_component",
"system::tests::removal_tracking",
"schedule::tests::conditions::system_conditions_and_change_detection",
"tests::resource_scope",
"tests::query_get",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"tests::remove",
"schedule::tests::base_sets::default_base_set_ordering",
"schedule::tests::system_ordering::add_systems_correct_order",
"tests::query_optional_component_sparse_no_match",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::tests::panic_inside_system - should panic",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"tests::reserve_and_spawn",
"tests::random_access",
"tests::remove_tracking",
"system::tests::query_set_system",
"tests::query_all_for_each",
"tests::query_single_component",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"tests::query_optional_component_sparse",
"system::tests::world_collections_system",
"system::tests::commands_param_set",
"system::tests::readonly_query_get_mut_component_fails",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::or_param_set_system",
"tests::resource",
"system::tests::any_of_has_filter_with_when_both_have_it",
"schedule::tests::conditions::multiple_conditions_on_system",
"tests::reserve_entities_across_worlds",
"system::tests::changed_resource_system",
"tests::non_send_resource_panic - should panic",
"tests::trackers_query",
"tests::par_for_each_dense",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"tests::test_is_archetypal_size_hints",
"tests::spawn_batch",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::sorted_remove",
"world::identifier::tests::world_ids_unique",
"world::tests::get_resource_by_id",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"tests::sparse_set_add_remove_many",
"world::tests::panic_while_overwriting_component",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::tests::inspect_entity_components",
"world::tests::custom_resource_with_layout",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::tests::iterate_entities",
"world::tests::spawn_empty_bundle",
"world::world_cell::tests::world_cell",
"tests::par_for_each_sparse",
"world::world_cell::tests::world_cell_mut_and_ref - should panic",
"world::world_cell::tests::world_access_reused",
"world::world_cell::tests::world_cell_ref_and_mut - should panic",
"world::world_cell::tests::world_cell_double_mut - should panic",
"world::world_cell::tests::world_cell_ref_and_ref",
"query::tests::query_filtered_exactsizeiterator_len",
"schedule::tests::system_ordering::order_systems",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 143) - compile",
"src/component.rs - component::Tick::set_changed (line 634) - compile",
"src/query/fetch.rs - query::fetch::WorldQuery (line 111) - compile fail",
"src/component.rs - component::Component (line 124) - compile fail",
"src/component.rs - component::ComponentTicks::set_changed (line 700) - compile",
"src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 153) - compile",
"src/query/iter.rs - query::iter::QueryCombinationIter (line 264)",
"src/bundle.rs - bundle::Bundle (line 93)",
"src/lib.rs - (line 239)",
"src/change_detection.rs - change_detection::DetectChanges (line 33)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 127)",
"src/change_detection.rs - change_detection::NonSendMut<'a,T>::map_unchanged (line 498)",
"src/lib.rs - (line 165)",
"src/component.rs - component::ComponentIdFor (line 716)",
"src/change_detection.rs - change_detection::ResMut<'a,T>::map_unchanged (line 465)",
"src/query/filter.rs - query::filter::With (line 24)",
"src/lib.rs - (line 189)",
"src/lib.rs - (line 30)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 227)",
"src/component.rs - component::Component (line 80)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 67)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 147)",
"src/query/filter.rs - query::filter::Added (line 578)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 148)",
"src/system/commands/mod.rs - system::commands::Command (line 24)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 514)",
"src/query/iter.rs - query::iter::QueryCombinationIter (line 250)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 487)",
"src/system/commands/mod.rs - system::commands::Commands (line 70)",
"src/entity/mod.rs - entity::Entity (line 77)",
"src/event.rs - event::EventReader<'w,'s,E>::is_empty (line 217)",
"src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 24)",
"src/query/filter.rs - query::filter::Or (line 232)",
"src/query/fetch.rs - query::fetch::ChangeTrackers (line 1096)",
"src/component.rs - component::StorageType (line 178)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 315)",
"src/query/fetch.rs - query::fetch::WorldQuery (line 202)",
"src/schedule/state.rs - schedule::state::States (line 28)",
"src/query/filter.rs - query::filter::Without (line 126)",
"src/lib.rs - (line 287)",
"src/event.rs - event::EventWriter (line 274)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::add (line 793)",
"src/change_detection.rs - change_detection::DetectChangesMut (line 77)",
"src/lib.rs - (line 212)",
"src/entity/map_entities.rs - entity::map_entities::MapEntities (line 34)",
"src/removal_detection.rs - removal_detection::RemovedComponents (line 119)",
"src/component.rs - component::Component (line 99)",
"src/system/commands/mod.rs - system::commands::Commands (line 88)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::insert (line 662)",
"src/component.rs - component::Component (line 134)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::despawn (line 768)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 432)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 270)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 460)",
"src/query/filter.rs - query::filter::Changed (line 614)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 211)",
"src/lib.rs - (line 74)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::remove (line 716)",
"src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::id (line 638)",
"src/system/system_param.rs - system::system_param::StaticSystemParam (line 1469) - compile fail",
"src/component.rs - component::Component (line 34)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::many (line 842) - compile",
"src/entity/mod.rs - entity::Entity (line 97)",
"src/system/system_param.rs - system::system_param::SystemParam (line 99) - compile fail",
"src/event.rs - event::EventWriter (line 257)",
"src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 357)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::many_mut (line 954) - compile",
"src/query/fetch.rs - query::fetch::WorldQuery (line 255)",
"src/system/query.rs - system::query::Query (line 97)",
"src/system/query.rs - system::query::Query (line 36)",
"src/system/query.rs - system::query::Query (line 57)",
"src/system/query.rs - system::query::Query (line 77)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_component_mut (line 1085)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_component (line 1027)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_inner (line 1435)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::is_empty (line 1313)",
"src/system/system_param.rs - system::system_param::Local (line 674)",
"src/system/query.rs - system::query::Query (line 113)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_combinations (line 421)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::single (line 1169)",
"src/system/system_param.rs - system::system_param::SystemParam (line 110)",
"src/system/system_param.rs - system::system_param::StaticSystemParam (line 1445)",
"src/system/system_param.rs - system::system_param::ParamSet (line 340)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_single (line 1197)",
"src/system/mod.rs - system (line 13)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_inner (line 1478)",
"src/system/system_param.rs - system::system_param::SystemParam (line 47)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_many_mut (line 548)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get (line 773)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::contains (line 1337)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_many (line 492)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::single_mut (line 1244)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_mut (line 389)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::for_each_mut (line 705)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_mut (line 889)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_single_mut (line 1274)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_combinations_mut (line 455)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter (line 352)",
"src/system/query.rs - system::query::Query<'w,'s,Q,F>::for_each (line 667)",
"src/system/system_param.rs - system::system_param::ParamSet (line 305)",
"src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 45)",
"src/lib.rs - (line 51)",
"src/system/function_system.rs - system::function_system::IntoSystem (line 312)",
"src/lib.rs - (line 124)",
"src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 406)",
"src/component.rs - component::Components::resource_id (line 527)",
"src/schedule/condition.rs - schedule::condition::common_conditions::not (line 356)",
"src/system/function_system.rs - system::function_system::SystemState (line 84)",
"src/system/function_system.rs - system::function_system::SystemState (line 116)",
"src/system/function_system.rs - system::function_system::In (line 347)",
"src/component.rs - component::Components::component_id (line 493)",
"src/system/system_piping.rs - system::system_piping::adapter::new (line 108)",
"src/world/mod.rs - world::World::despawn (line 610)",
"src/lib.rs - (line 41)",
"src/system/system_piping.rs - system::system_piping::adapter::dbg (line 194)",
"src/lib.rs - (line 254)",
"src/schedule/schedule.rs - schedule::schedule::Schedule (line 130)",
"src/lib.rs - (line 91)",
"src/world/mod.rs - world::World::entity (line 230)",
"src/system/system_piping.rs - system::system_piping::adapter::unwrap (line 136)",
"src/world/mod.rs - world::World::insert_or_spawn_batch (line 1152)",
"src/system/system_piping.rs - system::system_piping::adapter::warn (line 221)",
"src/system/function_system.rs - system::function_system::SystemParamFunction (line 546)",
"src/system/system_param.rs - system::system_param::Local (line 651)",
"src/schedule/condition.rs - schedule::condition::Condition::and_then (line 20)",
"src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::world_scope (line 593)",
"src/schedule/condition.rs - schedule::condition::Condition::or_else (line 71)",
"src/world/mod.rs - world::World::spawn (line 439)",
"src/system/system_piping.rs - system::system_piping::adapter::ignore (line 281)",
"src/event.rs - event::Events (line 79)",
"src/system/query.rs - system::query::Query (line 162)",
"src/world/mod.rs - world::World::get_entity_mut (line 381)",
"src/world/mod.rs - world::World::clear_trackers (line 652)",
"src/world/mod.rs - world::World::get (line 563)",
"src/schedule/condition.rs - schedule::condition::Condition::and_then (line 39)",
"src/system/query.rs - system::query::Query (line 139)",
"src/world/mod.rs - world::World::resource_scope (line 1270)",
"src/system/combinator.rs - system::combinator::Combine (line 15)",
"src/system/system_piping.rs - system::system_piping::adapter::info (line 167)",
"src/system/mod.rs - system (line 56)",
"src/system/system_param.rs - system::system_param::ParamSet (line 276)",
"src/world/mod.rs - world::World::spawn_batch (line 537)",
"src/world/mod.rs - world::World::entity_mut (line 255)",
"src/system/system_param.rs - system::system_param::Resource (line 387)",
"src/schedule/schedule.rs - schedule::schedule::Schedule (line 144)",
"src/query/state.rs - query::state::QueryState<Q,F>::get_many (line 231)",
"src/query/state.rs - query::state::QueryState<Q,F>::get_many_mut (line 291)",
"src/world/mod.rs - world::World::component_id (line 209)",
"src/world/mod.rs - world::World::get_entity (line 328)",
"src/world/mod.rs - world::World::query_filtered (line 749)",
"src/system/system_piping.rs - system::system_piping::PipeSystem (line 19)",
"src/world/mod.rs - world::World::get_mut (line 584)",
"src/system/system_piping.rs - system::system_piping::adapter::error (line 250)",
"src/system/commands/mod.rs - system::commands::EntityCommand (line 550)",
"src/world/mod.rs - world::World::query (line 682)",
"src/system/system_param.rs - system::system_param::Deferred (line 787)",
"src/world/mod.rs - world::World::query (line 718)",
"src/world/mod.rs - world::World::spawn_empty (line 406)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 7,454
|
bevyengine__bevy-7454
|
[
"7429"
] |
84de9e7f28bfaaba8e0eef4ecf185ce795add9e2
|
diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs
--- a/crates/bevy_reflect/src/impls/std.rs
+++ b/crates/bevy_reflect/src/impls/std.rs
@@ -1219,6 +1219,178 @@ impl FromReflect for Cow<'static, str> {
}
}
+impl<T: PathOnly> PathOnly for [T] where [T]: ToOwned {}
+
+impl<T: TypePath> TypePath for [T]
+where
+ [T]: ToOwned,
+{
+ fn type_path() -> &'static str {
+ static CELL: GenericTypePathCell = GenericTypePathCell::new();
+ CELL.get_or_insert::<Self, _>(|| format!("[{}]", <T>::type_path()))
+ }
+
+ fn short_type_path() -> &'static str {
+ static CELL: GenericTypePathCell = GenericTypePathCell::new();
+ CELL.get_or_insert::<Self, _>(|| format!("[{}]", <T>::short_type_path()))
+ }
+}
+
+impl<T: ToOwned> PathOnly for T {}
+
+impl<T: FromReflect + Clone + TypePath> List for Cow<'static, [T]> {
+ fn get(&self, index: usize) -> Option<&dyn Reflect> {
+ self.as_ref().get(index).map(|x| x as &dyn Reflect)
+ }
+
+ fn get_mut(&mut self, index: usize) -> Option<&mut dyn Reflect> {
+ self.to_mut().get_mut(index).map(|x| x as &mut dyn Reflect)
+ }
+
+ fn len(&self) -> usize {
+ self.as_ref().len()
+ }
+
+ fn iter(&self) -> crate::ListIter {
+ crate::ListIter::new(self)
+ }
+
+ fn drain(self: Box<Self>) -> Vec<Box<dyn Reflect>> {
+ // into_owned() is not uneccessary here because it avoids cloning whenever you have a Cow::Owned already
+ #[allow(clippy::unnecessary_to_owned)]
+ self.into_owned()
+ .into_iter()
+ .map(|value| value.clone_value())
+ .collect()
+ }
+
+ fn insert(&mut self, index: usize, element: Box<dyn Reflect>) {
+ let value = element.take::<T>().unwrap_or_else(|value| {
+ T::from_reflect(&*value).unwrap_or_else(|| {
+ panic!(
+ "Attempted to insert invalid value of type {}.",
+ value.type_name()
+ )
+ })
+ });
+ self.to_mut().insert(index, value);
+ }
+
+ fn remove(&mut self, index: usize) -> Box<dyn Reflect> {
+ Box::new(self.to_mut().remove(index))
+ }
+
+ fn push(&mut self, value: Box<dyn Reflect>) {
+ let value = T::take_from_reflect(value).unwrap_or_else(|value| {
+ panic!(
+ "Attempted to push invalid value of type {}.",
+ value.type_name()
+ )
+ });
+ self.to_mut().push(value);
+ }
+
+ fn pop(&mut self) -> Option<Box<dyn Reflect>> {
+ self.to_mut()
+ .pop()
+ .map(|value| Box::new(value) as Box<dyn Reflect>)
+ }
+}
+
+impl<T: FromReflect + Clone + TypePath> Reflect for Cow<'static, [T]> {
+ fn type_name(&self) -> &str {
+ std::any::type_name::<Self>()
+ }
+
+ fn into_any(self: Box<Self>) -> Box<dyn Any> {
+ self
+ }
+
+ fn as_any(&self) -> &dyn Any {
+ self
+ }
+
+ fn as_any_mut(&mut self) -> &mut dyn Any {
+ self
+ }
+
+ fn into_reflect(self: Box<Self>) -> Box<dyn Reflect> {
+ self
+ }
+
+ fn as_reflect(&self) -> &dyn Reflect {
+ self
+ }
+
+ fn as_reflect_mut(&mut self) -> &mut dyn Reflect {
+ self
+ }
+
+ fn apply(&mut self, value: &dyn Reflect) {
+ crate::list_apply(self, value);
+ }
+
+ fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>> {
+ *self = value.take()?;
+ Ok(())
+ }
+
+ fn reflect_ref(&self) -> ReflectRef {
+ ReflectRef::List(self)
+ }
+
+ fn reflect_mut(&mut self) -> ReflectMut {
+ ReflectMut::List(self)
+ }
+
+ fn reflect_owned(self: Box<Self>) -> ReflectOwned {
+ ReflectOwned::List(self)
+ }
+
+ fn clone_value(&self) -> Box<dyn Reflect> {
+ Box::new(List::clone_dynamic(self))
+ }
+
+ fn reflect_hash(&self) -> Option<u64> {
+ crate::list_hash(self)
+ }
+
+ fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool> {
+ crate::list_partial_eq(self, value)
+ }
+
+ fn get_represented_type_info(&self) -> Option<&'static TypeInfo> {
+ Some(<Self as Typed>::type_info())
+ }
+}
+
+impl<T: FromReflect + Clone + TypePath> Typed for Cow<'static, [T]> {
+ fn type_info() -> &'static TypeInfo {
+ static CELL: GenericTypeInfoCell = GenericTypeInfoCell::new();
+ CELL.get_or_insert::<Self, _>(|| TypeInfo::List(ListInfo::new::<Self, T>()))
+ }
+}
+
+impl<T: FromReflect + Clone + TypePath> GetTypeRegistration for Cow<'static, [T]> {
+ fn get_type_registration() -> TypeRegistration {
+ TypeRegistration::of::<Cow<'static, [T]>>()
+ }
+}
+
+impl<T: FromReflect + Clone + TypePath> FromReflect for Cow<'static, [T]> {
+ fn from_reflect(reflect: &dyn Reflect) -> Option<Self> {
+ if let ReflectRef::List(ref_list) = reflect.reflect_ref() {
+ let mut temp_vec = Vec::with_capacity(ref_list.len());
+ for field in ref_list.iter() {
+ temp_vec.push(T::from_reflect(field)?);
+ }
+ temp_vec.try_into().ok()
+ } else {
+ None
+ }
+ }
+}
+
impl Reflect for &'static Path {
fn type_name(&self) -> &str {
std::any::type_name::<Self>()
|
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -550,8 +550,12 @@ mod tests {
ser::{to_string_pretty, PrettyConfig},
Deserializer,
};
- use std::fmt::{Debug, Formatter};
- use std::{any::TypeId, marker::PhantomData};
+ use std::{
+ any::TypeId,
+ borrow::Cow,
+ fmt::{Debug, Formatter},
+ marker::PhantomData,
+ };
use super::prelude::*;
use super::*;
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -1031,6 +1035,8 @@ mod tests {
b: Bar,
u: usize,
t: ([f32; 3], String),
+ v: Cow<'static, str>,
+ w: Cow<'static, [u8]>,
}
let foo = Foo {
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -1039,6 +1045,8 @@ mod tests {
b: Bar { y: 255 },
u: 1111111111111,
t: ([3.0, 2.0, 1.0], "Tuple String".to_string()),
+ v: Cow::Owned("Cow String".to_string()),
+ w: Cow::Owned(vec![1, 2, 3]),
};
let foo2: Box<dyn Reflect> = Box::new(foo.clone());
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -1394,6 +1402,38 @@ mod tests {
let info = value.get_represented_type_info().unwrap();
assert!(info.is::<MyArray>());
+ // Cow<'static, str>
+ type MyCowStr = Cow<'static, str>;
+
+ let info = MyCowStr::type_info();
+ if let TypeInfo::Value(info) = info {
+ assert!(info.is::<MyCowStr>());
+ assert_eq!(std::any::type_name::<MyCowStr>(), info.type_name());
+ } else {
+ panic!("Expected `TypeInfo::Value`");
+ }
+
+ let value: &dyn Reflect = &Cow::<'static, str>::Owned("Hello!".to_string());
+ let info = value.get_represented_type_info().unwrap();
+ assert!(info.is::<MyCowStr>());
+
+ // Cow<'static, [u8]>
+ type MyCowSlice = Cow<'static, [u8]>;
+
+ let info = MyCowSlice::type_info();
+ if let TypeInfo::List(info) = info {
+ assert!(info.is::<MyCowSlice>());
+ assert!(info.item_is::<u8>());
+ assert_eq!(std::any::type_name::<MyCowSlice>(), info.type_name());
+ assert_eq!(std::any::type_name::<u8>(), info.item_type_name());
+ } else {
+ panic!("Expected `TypeInfo::List`");
+ }
+
+ let value: &dyn Reflect = &Cow::<'static, [u8]>::Owned(vec![0, 1, 2, 3]);
+ let info = value.get_represented_type_info().unwrap();
+ assert!(info.is::<MyCowSlice>());
+
// Map
type MyMap = HashMap<usize, f32>;
|
bevy_reflect: Support Cow<'static, [T]>
## What problem does this solve or what need does it fill?
At present, only `Cow<'static, str>` implements `Reflect`. However, `Cow` has another use: `Cow<'static, [T]>` for owned or borrowed lists.
## What solution would you like?
Implement `Reflect` and all other associated/required traits for `Cow<'static, [T]>`.
## What alternative(s) have you considered?
Just use a `Vec<T>`. However, `Vec`s don't work for const lists like arrays, and potentially use up more memory in the same way a `String` and `Cow<'static, str>` are compared.
|
2023-02-01T01:50:05Z
|
1.70
|
2023-06-19T15:25:35Z
|
6f27e0e35faffbf2b77807bb222d3d3a9a529210
|
[
"enums::tests::applying_non_enum_should_panic - should panic",
"enums::tests::enum_should_allow_struct_fields",
"enums::tests::enum_should_allow_nesting_enums",
"enums::tests::dynamic_enum_should_set_variant_fields",
"enums::tests::dynamic_enum_should_change_variant",
"enums::tests::enum_should_allow_generics",
"enums::tests::dynamic_enum_should_apply_dynamic_enum",
"enums::tests::enum_should_iterate_fields",
"enums::tests::enum_should_partial_eq",
"enums::tests::enum_should_return_correct_variant_path",
"enums::tests::enum_should_return_correct_variant_type",
"enums::tests::enum_should_set",
"enums::tests::partial_dynamic_enum_should_set_variant_fields",
"enums::tests::should_get_enum_type_info",
"impls::std::tests::option_should_apply",
"impls::std::tests::nonzero_usize_impl_reflect_from_reflect",
"impls::std::tests::instant_should_from_reflect",
"impls::std::tests::option_should_from_reflect",
"impls::std::tests::option_should_impl_enum",
"enums::tests::should_skip_ignored_fields",
"impls::std::tests::should_partial_eq_char",
"enums::tests::enum_should_apply",
"impls::std::tests::can_serialize_duration",
"impls::std::tests::path_should_from_reflect",
"impls::std::tests::option_should_impl_typed",
"impls::std::tests::should_partial_eq_hash_map",
"impls::std::tests::should_partial_eq_f32",
"impls::std::tests::should_partial_eq_i32",
"impls::std::tests::should_partial_eq_option",
"impls::std::tests::should_partial_eq_string",
"impls::std::tests::should_partial_eq_vec",
"list::tests::test_into_iter",
"map::tests::test_into_iter",
"map::tests::test_map_get_at",
"map::tests::test_map_get_at_mut",
"path::tests::parsed_path_parse",
"path::tests::reflect_array_behaves_like_list",
"path::tests::reflect_array_behaves_like_list_mut",
"path::tests::parsed_path_get_field",
"path::tests::reflect_path",
"serde::de::tests::should_deserialize_value",
"serde::de::tests::should_deserialized_typed",
"serde::de::tests::enum_should_deserialize",
"serde::de::tests::should_deserialize_option",
"serde::de::tests::should_deserialize_non_self_describing_binary",
"serde::de::tests::should_deserialize",
"serde::ser::tests::enum_should_serialize",
"serde::de::tests::should_deserialize_self_describing_binary",
"serde::ser::tests::should_serialize",
"serde::tests::test_serialization_tuple_struct",
"tests::as_reflect",
"serde::tests::unproxied_dynamic_should_not_serialize - should panic",
"serde::tests::test_serialization_struct",
"serde::ser::tests::should_serialize_non_self_describing_binary",
"serde::ser::tests::should_serialize_self_describing_binary",
"tests::custom_debug_function",
"serde::ser::tests::should_serialize_option",
"tests::from_reflect_should_use_default_container_attribute",
"tests::dynamic_names",
"tests::from_reflect_should_use_default_field_attributes",
"tests::from_reflect_should_use_default_variant_field_attributes",
"tests::into_reflect",
"tests::multiple_reflect_lists",
"tests::multiple_reflect_value_lists",
"tests::reflect_downcast",
"tests::reflect_ignore",
"tests::reflect_map",
"tests::reflect_complex_patch",
"tests::reflect_map_no_hash - should panic",
"tests::reflect_take",
"tests::reflect_struct",
"tests::reflect_type_path",
"tests::reflect_type_info",
"tests::reflect_unit_struct",
"tests::should_drain_fields",
"tests::should_permit_higher_ranked_lifetimes",
"tests::should_permit_valid_represented_type_for_dynamic",
"tests::should_prohibit_invalid_represented_type_for_dynamic - should panic",
"tests::should_reflect_debug",
"tests::should_call_from_reflect_dynamically",
"type_registry::test::test_reflect_from_ptr",
"type_uuid::test::test_generic_type_unique_uuid",
"tests::reflect_serialize",
"type_registry::test::test_property_type_registration",
"type_uuid::test::test_generic_type_uuid_derive",
"type_uuid::test::test_generic_type_uuid_same_for_eq_param",
"type_uuid::test::test_inverted_generic_type_unique_uuid",
"type_uuid::test::test_multiple_generic_uuid",
"type_uuid::test::test_primitive_generic_uuid",
"src/enums/variants.rs - enums::variants::VariantInfo::Unit (line 59)",
"src/enums/variants.rs - enums::variants::VariantType::Unit (line 28)",
"src/enums/variants.rs - enums::variants::VariantInfo::Struct (line 41)",
"src/enums/variants.rs - enums::variants::VariantType::Struct (line 10)",
"src/enums/variants.rs - enums::variants::VariantInfo::Tuple (line 51)",
"src/utility.rs - utility::NonGenericTypeCell (line 51)",
"src/enums/variants.rs - enums::variants::VariantType::Tuple (line 20)",
"src/utility.rs - utility::GenericTypeCell (line 171)",
"src/type_path.rs - type_path::TypePath (line 37)",
"src/utility.rs - utility::GenericTypeCell (line 129)",
"src/type_info.rs - type_info::Typed (line 25)",
"src/lib.rs - (line 260)",
"src/lib.rs - (line 31)",
"src/enums/dynamic_enum.rs - enums::dynamic_enum::DynamicEnum (line 54)",
"src/lib.rs - (line 134)",
"src/from_reflect.rs - from_reflect::ReflectFromReflect (line 57)",
"src/tuple_struct.rs - tuple_struct::GetTupleStructField (line 176)",
"src/lib.rs - (line 77)",
"src/array.rs - array::array_debug (line 434)",
"src/tuple_struct.rs - tuple_struct::tuple_struct_debug (line 436)",
"src/path.rs - path::GetPath (line 115)",
"src/list.rs - list::List (line 36)",
"src/struct_trait.rs - struct_trait::struct_debug (line 536)",
"src/lib.rs - (line 278)",
"src/lib.rs - (line 207)",
"src/tuple_struct.rs - tuple_struct::TupleStruct (line 20)",
"src/lib.rs - (line 169)",
"src/tuple.rs - tuple::Tuple (line 23)",
"src/map.rs - map::map_debug (line 463)",
"src/map.rs - map::Map (line 26)",
"src/lib.rs - (line 239)",
"src/path.rs - path::GetPath (line 78)",
"src/lib.rs - (line 183)",
"src/struct_trait.rs - struct_trait::Struct (line 24)",
"src/type_registry.rs - type_registry::TypeRegistration (line 292)",
"src/struct_trait.rs - struct_trait::GetField (line 225)",
"src/lib.rs - (line 98)",
"src/enums/helpers.rs - enums::helpers::enum_debug (line 82)",
"src/tuple.rs - tuple::GetTupleField (line 94)",
"src/lib.rs - (line 148)",
"src/array.rs - array::Array (line 30)",
"src/list.rs - list::list_debug (line 477)",
"src/type_registry.rs - type_registry::ReflectFromPtr (line 507)",
"src/type_registry.rs - type_registry::TypeRegistry::register_type_data (line 138)",
"src/path.rs - path::GetPath (line 101)",
"src/path.rs - path::GetPath (line 137)",
"src/from_reflect.rs - from_reflect::ReflectFromReflect (line 77)",
"src/tuple.rs - tuple::tuple_debug (line 450)",
"src/path.rs - path::GetPath (line 167)",
"src/path.rs - path::ParsedPath::parse (line 312)",
"src/lib.rs - (line 321)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 1,070
|
bevyengine__bevy-1070
|
[
"1036"
] |
51650f114fbf31fc89db7bd69542dc21edf2dcb7
|
diff --git a/crates/bevy_ui/src/focus.rs b/crates/bevy_ui/src/focus.rs
--- a/crates/bevy_ui/src/focus.rs
+++ b/crates/bevy_ui/src/focus.rs
@@ -1,11 +1,9 @@
use crate::Node;
-use bevy_app::{EventReader, Events};
use bevy_core::FloatOrd;
use bevy_ecs::prelude::*;
use bevy_input::{mouse::MouseButton, touch::Touches, Input};
-use bevy_math::Vec2;
use bevy_transform::components::GlobalTransform;
-use bevy_window::CursorMoved;
+use bevy_window::Windows;
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Interaction {
diff --git a/crates/bevy_ui/src/focus.rs b/crates/bevy_ui/src/focus.rs
--- a/crates/bevy_ui/src/focus.rs
+++ b/crates/bevy_ui/src/focus.rs
@@ -34,15 +32,13 @@ impl Default for FocusPolicy {
#[derive(Default)]
pub struct State {
- cursor_moved_event_reader: EventReader<CursorMoved>,
- cursor_position: Vec2,
hovered_entity: Option<Entity>,
}
pub fn ui_focus_system(
mut state: Local<State>,
+ windows: Res<Windows>,
mouse_button_input: Res<Input<MouseButton>>,
- cursor_moved_events: Res<Events<CursorMoved>>,
touches_input: Res<Touches>,
mut node_query: Query<(
Entity,
diff --git a/crates/bevy_ui/src/focus.rs b/crates/bevy_ui/src/focus.rs
--- a/crates/bevy_ui/src/focus.rs
+++ b/crates/bevy_ui/src/focus.rs
@@ -85,8 +83,8 @@ pub fn ui_focus_system(
let min = ui_position - extents;
let max = ui_position + extents;
// if the current cursor position is within the bounds of the node, consider it for clicking
- if (min.x..max.x).contains(&state.cursor_position.x)
- && (min.y..max.y).contains(&state.cursor_position.y)
+ if (min.x..max.x).contains(&cursor_position.x)
+ && (min.y..max.y).contains(&cursor_position.y)
{
Some((entity, focus_policy, interaction, FloatOrd(position.z)))
} else {
|
diff --git a/crates/bevy_ui/src/focus.rs b/crates/bevy_ui/src/focus.rs
--- a/crates/bevy_ui/src/focus.rs
+++ b/crates/bevy_ui/src/focus.rs
@@ -52,12 +48,14 @@ pub fn ui_focus_system(
Option<&FocusPolicy>,
)>,
) {
- if let Some(cursor_moved) = state.cursor_moved_event_reader.latest(&cursor_moved_events) {
- state.cursor_position = cursor_moved.position;
- }
- if let Some(touch) = touches_input.get_pressed(0) {
- state.cursor_position = touch.position();
- }
+ let cursor_position = if let Some(cursor_position) = windows
+ .get_primary()
+ .and_then(|window| window.cursor_position())
+ {
+ cursor_position
+ } else {
+ return;
+ };
if mouse_button_input.just_released(MouseButton::Left) || touches_input.just_released(0) {
for (_entity, _node, _global_transform, interaction, _focus_policy) in node_query.iter_mut()
|
ButtonBundle starts up with Hovered Interaction.
**Bevy version**
bevy = { git = "https://github.com/bevyengine/bevy", version = "0.3.0" }
**Operating system & version**
Windows 10
**What you did**
```
use bevy::prelude::*;
struct Output {
msg: String,
msg_prev: String,
}
impl Default for Output {
fn default() -> Self {
Output {
msg: String::new(),
msg_prev: String::new(),
}
}
}
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.add_system(interaction)
.init_resource::<Output>()
.add_system(debug)
.run();
}
fn setup(cmds: &mut Commands) {
cmds.spawn(CameraUiBundle::default());
cmds.spawn(ButtonBundle {
style: Style {
size: Size::new(Val::Px(120.0), Val::Px(120.0)),
..Default::default()
},
..Default::default()
});
}
fn interaction(mut output: ResMut<Output>, i_query: Query<&Interaction>) {
for a in i_query.iter() {
match *a {
Interaction::Clicked => output.msg = "Clicked".to_string(),
Interaction::Hovered => output.msg = "Hover".to_string(),
Interaction::None => output.msg = "Normal".to_string(),
}
}
}
fn debug(mut mut_res: ResMut<Output>) {
if mut_res.msg != mut_res.msg_prev {
println!("{}", mut_res.msg);
mut_res.msg_prev = mut_res.msg.clone();
}
}
```
**What you expected to happen**
I expected to start my application with `Interaction::None`.
**What actually happened**
> Normal
> Dec 08 21:09:46.756 WARN wgpu_core::device: Failed to parse shader SPIR-V code: UnsupportedBuiltIn(4)
> Dec 08 21:09:46.756 WARN wgpu_core::device: Shader module will not be validated
> Hover
**Additional information**
- I am not sure if the **WARN** messages are relevant, though I found it odd that they show up between the change in state.
- If setup is changed to add a second button, `Interaction::Hovered` never happens.
- If the mouse is within the bounds of the window, `Interaction::Hovered` never happens.
- If the mouse is within the bounds of the button, `Interaction::Hovered` occurs as expected.
|
the issue is that before you move your mouse, it uses the default value for a position which is `(0, 0)` so over your button in the corner... it's the default value of [this field](https://github.com/bevyengine/bevy/blob/c54179b1829e90d6da8323b67bbab8fe3d4af4b4/crates/bevy_ui/src/focus.rs#L38). This should be fixed, maybe by using an option to ignore mouse interaction before the mouse has been moved for the first time.
for your issue with two buttons, as you are using a single resource to keep the state of all your buttons, you can only see the state of one button (the last added)
if you change your system like this:
```rust
fn interaction(mut output: ResMut<Output>, i_query: Query<&Interaction, Changed<Interaction>>) {
for a in i_query.iter() {
eprintln!("{:?}", a);
match *a {
Interaction::Clicked => output.msg = "Clicked".to_string(),
Interaction::Hovered => output.msg = "Hover".to_string(),
Interaction::None => output.msg = "Normal".to_string(),
}
}
}
```
you should see all interactions. I added a filter `Changed<Interaction>` to the query to not be flooded every frame
Thank you for the input. I'm still trying to figure out some of the `Query` stuff.
As for the position, it would be better if the position could be determined prior to events. Otherwise, you could end up with the reverse situation of `Hovered` not triggering when it should. While this is such a minor issue, it would prevent odd behavior that makes UI feel a little clunky.
|
2020-12-15T09:47:12Z
|
0.3
|
2021-04-27T23:51:09Z
|
51650f114fbf31fc89db7bd69542dc21edf2dcb7
|
[
"update::tests::test_ui_z_system"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 763
|
bevyengine__bevy-763
|
[
"762"
] |
9cc6368b28a2df2dff652ae1a087f74fd0362a6a
|
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -263,6 +263,9 @@ macro_rules! impl_or_query {
true $( && $T.should_skip(n) )+
}
}
+
+ unsafe impl<$( $T: ReadOnlyFetch ),+> ReadOnlyFetch for Or<($( $T ),+)> {}
+ unsafe impl<$( $T: ReadOnlyFetch ),+> ReadOnlyFetch for FetchOr<($( $T ),+)> {}
};
}
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -320,6 +323,7 @@ impl<'a, T: Component> Query for Mutated<'a, T> {
#[doc(hidden)]
pub struct FetchMutated<T>(NonNull<T>, NonNull<bool>);
+unsafe impl<T> ReadOnlyFetch for FetchMutated<T> {}
impl<'a, T: Component> Fetch<'a> for FetchMutated<T> {
type Item = Mutated<'a, T>;
|
diff --git a/crates/bevy_ecs/src/system/into_system.rs b/crates/bevy_ecs/src/system/into_system.rs
--- a/crates/bevy_ecs/src/system/into_system.rs
+++ b/crates/bevy_ecs/src/system/into_system.rs
@@ -489,6 +489,43 @@ mod tests {
assert!(*resources.get::<bool>().unwrap(), "system ran");
}
+ #[test]
+ fn or_query_set_system() {
+ // Regression test for issue #762
+ use crate::{Added, Changed, Mutated, Or};
+ fn query_system(
+ mut ran: ResMut<bool>,
+ set: QuerySet<(
+ Query<Or<(Changed<A>, Changed<B>)>>,
+ Query<Or<(Added<A>, Added<B>)>>,
+ Query<Or<(Mutated<A>, Mutated<B>)>>,
+ )>,
+ ) {
+ let changed = set.q0().iter().count();
+ let added = set.q1().iter().count();
+ let mutated = set.q2().iter().count();
+
+ assert_eq!(changed, 1);
+ assert_eq!(added, 1);
+ assert_eq!(mutated, 0);
+
+ *ran = true;
+ }
+
+ let mut world = World::default();
+ let mut resources = Resources::default();
+ resources.insert(false);
+ world.spawn((A, B));
+
+ let mut schedule = Schedule::default();
+ schedule.add_stage("update");
+ schedule.add_system_to_stage("update", query_system.system());
+
+ schedule.run(&mut world, &mut resources);
+
+ assert!(*resources.get::<bool>().unwrap(), "system ran");
+ }
+
#[test]
fn changed_resource_system() {
fn incr_e_on_flip(_run_on_flip: ChangedRes<bool>, mut i: Mut<i32>) {
|
Query using the Or operator do not provide .iter() method, only iter_mut().
**Bevy version**
Following version, containing changes on query:
9cc6368b28a2df2dff652ae1a087f74fd0362a6a
**Operating system & version**
Ubuntu 20.04
**What you did**
The following query, that contains an Or, does not have the .iter() method, only iter_mut()
```rust
mut query_changed_camera: Query<(
&Camera,
Or<(Changed<OrthographicProjection>, Changed<Transform>)>,
)>,
```
```rust
for (camera, (camera_ortho, camera_transform)) in query_changed_camera.iter() {
```
**What you expected to happen**
Should have compiled
**What actually happened**
Compilation failed:
```rust
error[E0277]: the trait bound `bevy_hecs::query::FetchOr<(bevy_hecs::query::FetchChanged<bevy::render::camera::OrthographicProjection>, bevy_hecs::query::FetchChanged<bevy::prelude::Transform>)>: bevy::ecs::ReadOnlyFetch` is not satisfied
--> src/cursor_2dworld_pos_plugin.rs:62:76
|
62 | for (camera, (camera_ortho, camera_transform)) in query_changed_camera.iter() {
| ^^^^ the trait `bevy::ecs::ReadOnlyFetch` is not implemented for `bevy_hecs::query::FetchOr<(bevy_hecs::query::FetchChanged<bevy::render::camera::OrthographicProjection>, bevy_hecs::query::FetchChanged<bevy::prelude::Transform>)>`
|
= note: required because of the requirements on the impl of `bevy::ecs::ReadOnlyFetch` for `(bevy_hecs::query::FetchRead<bevy::render::camera::Camera>, bevy_hecs::query::FetchOr<(bevy_hecs::query::FetchChanged<bevy::render::camera::OrthographicProjection>, bevy_hecs::query::FetchChanged<bevy::prelude::Transform>)>)`
```
**Additional information**
Using the .iter_mut() method works, so, nothing critical here.
As discussed in the discord, the culprit is the 'Or' , not the Changed.
it can be the same issue as #753 , but we were not sure on discord, so filing another issue.
|
2020-11-01T15:30:51Z
|
0.2
|
2020-11-02T00:51:52Z
|
9cc6368b28a2df2dff652ae1a087f74fd0362a6a
|
[
"resource::resources::tests::thread_local_resource",
"resource::resource_query::tests::changed_resource",
"resource::resources::tests::resource",
"resource::resource_query::tests::or_changed_resource",
"resource::resources::tests::thread_local_resource_ref_aliasing",
"resource::resources::tests::resource_double_mut_panic",
"resource::resources::tests::thread_local_resource_mut_ref_aliasing",
"resource::resources::tests::thread_local_resource_panic",
"system::commands::tests::command_buffer",
"system::into_system::tests::conflicting_query_immut_system",
"system::into_system::tests::conflicting_query_sets_system",
"system::into_system::tests::conflicting_query_with_query_set_system",
"system::into_system::tests::conflicting_query_mut_system",
"system::into_system::tests::changed_resource_system",
"system::into_system::tests::query_set_system",
"system::into_system::tests::query_system_gets",
"schedule::parallel_executor::tests::cross_stage_archetype_change_prepare",
"schedule::parallel_executor::tests::intra_stage_archetype_change_prepare",
"schedule::parallel_executor::tests::schedule"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 543
|
bevyengine__bevy-543
|
[
"541"
] |
9a4167ef7f5115f7fc045a881f5c865f568d34c0
|
diff --git a/crates/bevy_ecs/hecs/src/query_one.rs b/crates/bevy_ecs/hecs/src/query_one.rs
--- a/crates/bevy_ecs/hecs/src/query_one.rs
+++ b/crates/bevy_ecs/hecs/src/query_one.rs
@@ -37,7 +37,11 @@ impl<'a, Q: Query> QueryOne<'a, Q> {
pub fn get(&mut self) -> Option<<Q::Fetch as Fetch<'_>>::Item> {
unsafe {
let mut fetch = Q::Fetch::get(self.archetype, self.index)?;
- Some(fetch.next())
+ if fetch.should_skip() {
+ None
+ } else {
+ Some(fetch.next())
+ }
}
}
diff --git a/crates/bevy_ecs/hecs/src/query_one.rs b/crates/bevy_ecs/hecs/src/query_one.rs
--- a/crates/bevy_ecs/hecs/src/query_one.rs
+++ b/crates/bevy_ecs/hecs/src/query_one.rs
@@ -104,7 +108,11 @@ where
{
unsafe {
let mut fetch = Q::Fetch::get(self.archetype, self.index)?;
- Some(fetch.next())
+ if fetch.should_skip() {
+ None
+ } else {
+ Some(fetch.next())
+ }
}
}
|
diff --git a/crates/bevy_ecs/hecs/tests/tests.rs b/crates/bevy_ecs/hecs/tests/tests.rs
--- a/crates/bevy_ecs/hecs/tests/tests.rs
+++ b/crates/bevy_ecs/hecs/tests/tests.rs
@@ -365,3 +365,35 @@ fn remove_tracking() {
"world clears result in 'removed component' states"
);
}
+
+#[test]
+fn added_tracking() {
+ let mut world = World::new();
+ let a = world.spawn((123,));
+
+ assert_eq!(world.query::<&i32>().iter().count(), 1);
+ assert_eq!(world.query::<Added<i32>>().iter().count(), 1);
+ assert_eq!(world.query_mut::<&i32>().iter().count(), 1);
+ assert_eq!(world.query_mut::<Added<i32>>().iter().count(), 1);
+ assert!(world.query_one::<&i32>(a).unwrap().get().is_some());
+ assert!(world.query_one::<Added<i32>>(a).unwrap().get().is_some());
+ assert!(world.query_one_mut::<&i32>(a).unwrap().get().is_some());
+ assert!(world
+ .query_one_mut::<Added<i32>>(a)
+ .unwrap()
+ .get()
+ .is_some());
+
+ world.clear_trackers();
+
+ assert_eq!(world.query::<&i32>().iter().count(), 1);
+ assert_eq!(world.query::<Added<i32>>().iter().count(), 0);
+ assert_eq!(world.query_mut::<&i32>().iter().count(), 1);
+ assert_eq!(world.query_mut::<Added<i32>>().iter().count(), 0);
+ assert!(world.query_one_mut::<&i32>(a).unwrap().get().is_some());
+ assert!(world
+ .query_one_mut::<Added<i32>>(a)
+ .unwrap()
+ .get()
+ .is_none());
+}
|
Added<X> not properly filtered in QueryOne.get() and Query.get() methods
With the following standalone testcase, after the second iteration when Added counting becomes 0, I think we should also see both boolean be false.
The second boolean, being based QueryOne.get() has been reported by @cart to behave incorrectly in #488.
But I suspect the first one, based onQuery.get() should also return false ?
```rust
use bevy::prelude::*;
fn main() {
App::build()
.add_default_plugins()
.add_startup_system(startup_system.system())
.add_system(normal_system.system())
.run();
}
struct Comp {}
/// Startup systems are run exactly once when the app starts up.
/// They run right before "normal" systems run.
fn startup_system(mut commands: Commands) {
commands.spawn((Comp {},));
let entity = commands.current_entity().unwrap();
commands.insert_resource(entity);
}
fn normal_system(
entity: Res<Entity>,
mut query: Query<(&Comp,)>,
mut query_added: Query<(Added<Comp>,)>,
) {
let mut n_comp = 0;
let mut n_added = 0;
for (_comp,) in &mut query.iter() {
n_comp += 1;
}
for (_comp,) in &mut query_added.iter() {
n_added += 1;
}
let found1 = query_added.get::<Comp>(*entity).is_some();
let mut one = query_added.entity(*entity).unwrap();
let found2 = one.get().is_some();
println!(
"Count: {}, Added: {}, query.get {} query.entity.get {}",
n_comp, n_added, found1, found2
);
}
```
|
2020-09-21T12:42:19Z
|
0.2
|
2020-10-05T17:38:13Z
|
9cc6368b28a2df2dff652ae1a087f74fd0362a6a
|
[
"added_tracking"
] |
[
"bad_bundle_derive",
"alias",
"clear",
"despawn",
"derived_bundle",
"query_missing_component",
"dynamic_components",
"build_entity",
"query_batched",
"query_all",
"query_optional_component",
"remove_missing",
"random_access",
"query_single_component",
"query_one",
"query_sparse_component",
"shared_borrow",
"spawn_batch",
"remove_tracking",
"spawn_many"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 488
|
bevyengine__bevy-488
|
[
"476"
] |
74ad1c375268cedfbb3b218cfc5e86b8d54e1885
|
diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs
--- a/crates/bevy_render/src/camera/camera.rs
+++ b/crates/bevy_render/src/camera/camera.rs
@@ -1,6 +1,6 @@
use super::CameraProjection;
use bevy_app::prelude::{EventReader, Events};
-use bevy_ecs::{Component, Local, Query, Res};
+use bevy_ecs::{Added, Component, Entity, Local, Query, Res};
use bevy_math::Mat4;
use bevy_property::Properties;
use bevy_window::{WindowCreated, WindowId, WindowResized, Windows};
diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs
--- a/crates/bevy_render/src/camera/camera.rs
+++ b/crates/bevy_render/src/camera/camera.rs
@@ -67,9 +68,13 @@ pub fn camera_system<T: CameraProjection + Component>(
changed_window_ids.push(event.id);
}
- for (mut camera, mut camera_projection) in &mut query.iter() {
+ let mut added_cameras = vec![];
+ for (entity, _camera) in &mut query_added.iter() {
+ added_cameras.push(entity);
+ }
+ for (entity, mut camera, mut camera_projection) in &mut query.iter() {
if let Some(window) = windows.get(camera.window) {
- if changed_window_ids.contains(&window.id) {
+ if changed_window_ids.contains(&window.id) || added_cameras.contains(&entity) {
camera_projection.update(window.width as usize, window.height as usize);
camera.projection_matrix = camera_projection.get_projection_matrix();
camera.depth_calculation = camera_projection.depth_calculation();
|
diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs
--- a/crates/bevy_render/src/camera/camera.rs
+++ b/crates/bevy_render/src/camera/camera.rs
@@ -38,7 +38,8 @@ pub fn camera_system<T: CameraProjection + Component>(
window_resized_events: Res<Events<WindowResized>>,
window_created_events: Res<Events<WindowCreated>>,
windows: Res<Windows>,
- mut query: Query<(&mut Camera, &mut T)>,
+ mut query: Query<(Entity, &mut Camera, &mut T)>,
+ mut query_added: Query<(Entity, Added<Camera>)>,
) {
let mut changed_window_ids = Vec::new();
// handle resize events. latest events are handled first because we only want to resize each window once
|
Camera2dComponents spawned after frame 3 no more display anything.
I reproduced the issue by modifying the sprite.rs example to not spawn on startup, but after X frames.
If X >=3 the bevy logo no more appear.
Is there something that needs to be done to have the 2d camera work when spawned later in the life of the application ?
```rust
use bevy::prelude::*;
fn main() {
App::build()
.add_default_plugins()
.add_resource(1u32)
.add_system(setup.system())
.run();
}
const FRAME_SPAWN: u32 = 3;
fn setup(
mut commands: Commands,
count: Res<u32>,
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
if *count <= FRAME_SPAWN {
println!("FRAME {}", *count);
if *count == FRAME_SPAWN {
let texture_handle = asset_server.load("assets/branding/icon.png").unwrap();
commands.spawn(Camera2dComponents::default());
commands.spawn(SpriteComponents {
material: materials.add(texture_handle.into()),
..Default::default()
});
println!("Camera spawned");
}
commands.insert_resource(*count + 1);
}
}
```
|
Doing the same test for the example/3d_scene.rs with the Camera3dComponents gave the same strange behaviour.
Spawning at frame 1 or 2 is displaying correctly, spawning starting from frame 3 nothing appears.
Hmm looks like resizing the window "fixes" this problem. Printing out the `OrthographicProjection` component illustrates that the projection isn't getting updated to match the current window size.
We could probably fix this by extending `camera_system` to also update projections when a camera is added. We could use an `Added<T>` query for this.
|
2020-09-14T08:19:21Z
|
0.2
|
2020-10-05T17:41:35Z
|
9cc6368b28a2df2dff652ae1a087f74fd0362a6a
|
[
"color::test_hex_color",
"mesh::mesh::tests::test_get_vertex_bytes",
"batch::batcher::tests::test_batcher_2",
"render_graph::graph::tests::test_edge_already_exists",
"render_graph::graph::tests::test_get_node_typed",
"render_graph::graph::tests::test_slot_already_occupied",
"render_graph::graph::tests::test_graph_edges",
"renderer::render_resource::render_resource_bindings::tests::test_bind_groups",
"render_graph::schedule::tests::test_render_graph_dependency_stager_loose",
"render_graph::schedule::tests::test_render_graph_dependency_stager_tight",
"shader::shader_reflect::tests::test_reflection",
"shader::shader_reflect::tests::test_reflection_consecutive_buffer_validation"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 404
|
bevyengine__bevy-404
|
[
"333"
] |
0f43fb066f42e459e2f68bc5009af47c00fdc510
|
diff --git a/crates/bevy_ecs/hecs/src/archetype.rs b/crates/bevy_ecs/hecs/src/archetype.rs
--- a/crates/bevy_ecs/hecs/src/archetype.rs
+++ b/crates/bevy_ecs/hecs/src/archetype.rs
@@ -404,11 +404,15 @@ impl Archetype {
size: usize,
index: usize,
added: bool,
+ mutated: bool,
) {
let state = self.state.get_mut(&ty).unwrap();
if added {
state.added_entities[index] = true;
}
+ if mutated {
+ state.mutated_entities[index] = true;
+ }
let ptr = (*self.data.get())
.as_ptr()
.add(state.offset + size * index)
diff --git a/crates/bevy_ecs/hecs/src/world.rs b/crates/bevy_ecs/hecs/src/world.rs
--- a/crates/bevy_ecs/hecs/src/world.rs
+++ b/crates/bevy_ecs/hecs/src/world.rs
@@ -103,7 +103,7 @@ impl World {
unsafe {
let index = archetype.allocate(entity);
components.put(|ptr, ty, size| {
- archetype.put_dynamic(ptr, ty, size, index, true);
+ archetype.put_dynamic(ptr, ty, size, index, true, false);
true
});
self.entities.meta[entity.id as usize].location = Location {
diff --git a/crates/bevy_ecs/hecs/src/world.rs b/crates/bevy_ecs/hecs/src/world.rs
--- a/crates/bevy_ecs/hecs/src/world.rs
+++ b/crates/bevy_ecs/hecs/src/world.rs
@@ -547,7 +547,7 @@ impl World {
// Update components in the current archetype
let arch = &mut self.archetypes[loc.archetype as usize];
components.put(|ptr, ty, size| {
- arch.put_dynamic(ptr, ty, size, loc.index, false);
+ arch.put_dynamic(ptr, ty, size, loc.index, false, true);
true
});
return Ok(());
diff --git a/crates/bevy_ecs/hecs/src/world.rs b/crates/bevy_ecs/hecs/src/world.rs
--- a/crates/bevy_ecs/hecs/src/world.rs
+++ b/crates/bevy_ecs/hecs/src/world.rs
@@ -564,7 +564,7 @@ impl World {
let old_index = mem::replace(&mut loc.index, target_index);
if let Some(moved) =
source_arch.move_to(old_index, |ptr, ty, size, is_added, is_mutated| {
- target_arch.put_dynamic(ptr, ty, size, target_index, false);
+ target_arch.put_dynamic(ptr, ty, size, target_index, false, false);
let type_state = target_arch.get_type_state_mut(ty).unwrap();
*type_state.added().as_ptr().add(target_index) = is_added;
*type_state.mutated().as_ptr().add(target_index) = is_mutated;
diff --git a/crates/bevy_ecs/hecs/src/world.rs b/crates/bevy_ecs/hecs/src/world.rs
--- a/crates/bevy_ecs/hecs/src/world.rs
+++ b/crates/bevy_ecs/hecs/src/world.rs
@@ -574,7 +574,8 @@ impl World {
}
components.put(|ptr, ty, size| {
- target_arch.put_dynamic(ptr, ty, size, target_index, true);
+ let had_component = source_arch.has_dynamic(ty);
+ target_arch.put_dynamic(ptr, ty, size, target_index, !had_component, had_component);
true
});
}
diff --git a/crates/bevy_ecs/hecs/src/world.rs b/crates/bevy_ecs/hecs/src/world.rs
--- a/crates/bevy_ecs/hecs/src/world.rs
+++ b/crates/bevy_ecs/hecs/src/world.rs
@@ -1020,7 +1021,8 @@ where
unsafe {
let index = self.archetype.allocate(entity);
components.put(|ptr, ty, size| {
- self.archetype.put_dynamic(ptr, ty, size, index, true);
+ self.archetype
+ .put_dynamic(ptr, ty, size, index, true, false);
true
});
self.entities.meta[entity.id as usize].location = Location {
diff --git a/crates/bevy_ecs/src/resource/resources.rs b/crates/bevy_ecs/src/resource/resources.rs
--- a/crates/bevy_ecs/src/resource/resources.rs
+++ b/crates/bevy_ecs/src/resource/resources.rs
@@ -234,6 +234,7 @@ impl Resources {
core::mem::size_of::<T>(),
index,
added,
+ !added,
);
std::mem::forget(resource);
}
|
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1089,7 +1089,7 @@ mod tests {
}
}
- fn get_changed_a(world: &mut World) -> Vec<Entity> {
+ fn get_mutated_a(world: &mut World) -> Vec<Entity> {
world
.query_mut::<(Mutated<A>, Entity)>()
.iter()
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1097,17 +1097,17 @@ mod tests {
.collect::<Vec<Entity>>()
};
- assert_eq!(get_changed_a(&mut world), vec![e1, e3]);
+ assert_eq!(get_mutated_a(&mut world), vec![e1, e3]);
// ensure changing an entity's archetypes also moves its mutated state
world.insert(e1, (C,)).unwrap();
- assert_eq!(get_changed_a(&mut world), vec![e3, e1], "changed entities list should not change (although the order will due to archetype moves)");
+ assert_eq!(get_mutated_a(&mut world), vec![e3, e1], "changed entities list should not change (although the order will due to archetype moves)");
// spawning a new A entity should not change existing mutated state
world.insert(e1, (A(0), B)).unwrap();
assert_eq!(
- get_changed_a(&mut world),
+ get_mutated_a(&mut world),
vec![e3, e1],
"changed entities list should not change"
);
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1115,7 +1115,7 @@ mod tests {
// removing an unchanged entity should not change mutated state
world.despawn(e2).unwrap();
assert_eq!(
- get_changed_a(&mut world),
+ get_mutated_a(&mut world),
vec![e3, e1],
"changed entities list should not change"
);
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1123,7 +1123,7 @@ mod tests {
// removing a changed entity should remove it from enumeration
world.despawn(e1).unwrap();
assert_eq!(
- get_changed_a(&mut world),
+ get_mutated_a(&mut world),
vec![e3],
"e1 should no longer be returned"
);
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1134,8 +1134,46 @@ mod tests {
.query_mut::<(Mutated<A>, Entity)>()
.iter()
.map(|(_a, e)| e)
- .collect::<Vec<Entity>>()
- .is_empty());
+ .next()
+ .is_none());
+
+ let e4 = world.spawn(());
+
+ world.insert_one(e4, A(0)).unwrap();
+ assert!(get_mutated_a(&mut world).is_empty());
+
+ world.insert_one(e4, A(1)).unwrap();
+ assert_eq!(get_mutated_a(&mut world), vec![e4]);
+
+ world.clear_trackers();
+
+ // ensure inserting multiple components set mutated state for
+ // already existing components and set added state for
+ // non existing components even when changing archetype.
+ world.insert(e4, (A(0), B(0))).unwrap();
+
+ let added_a = world
+ .query::<(Added<A>, Entity)>()
+ .iter()
+ .map(|(_, e)| e)
+ .next();
+ assert!(added_a.is_none());
+
+ assert_eq!(get_mutated_a(&mut world), vec![e4]);
+
+ let added_b = world
+ .query::<(Added<B>, Entity)>()
+ .iter()
+ .map(|(_, e)| e)
+ .next();
+ assert!(added_b.is_some());
+
+ let mutated_b = world
+ .query_mut::<(Mutated<B>, Entity)>()
+ .iter()
+ .map(|(_, e)| e)
+ .next();
+ assert!(mutated_b.is_none());
}
#[test]
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1153,12 +1191,12 @@ mod tests {
b.0 += 1;
}
- let a_b_changed = world
+ let a_b_mutated = world
.query_mut::<(Mutated<A>, Mutated<B>, Entity)>()
.iter()
.map(|(_a, _b, e)| e)
.collect::<Vec<Entity>>();
- assert_eq!(a_b_changed, vec![e2]);
+ assert_eq!(a_b_mutated, vec![e2]);
}
#[test]
diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs
--- a/crates/bevy_ecs/hecs/src/query.rs
+++ b/crates/bevy_ecs/hecs/src/query.rs
@@ -1178,13 +1216,13 @@ mod tests {
b.0 += 1;
}
- let a_b_changed = world
+ let a_b_mutated = world
.query_mut::<(Or<(Mutated<A>, Mutated<B>)>, Entity)>()
.iter()
.map(|((_a, _b), e)| e)
.collect::<Vec<Entity>>();
// e1 has mutated A, e3 has mutated B, e2 has mutated A and B, _e4 has no mutated component
- assert_eq!(a_b_changed, vec![e1, e2, e3]);
+ assert_eq!(a_b_mutated, vec![e1, e2, e3]);
}
#[test]
|
Mutating a component with insert(_one) doesn't trigger Mutated query filter
## Expected Behavior
I tried to make a small example and it should print "Tag added" once because the system with Added filter should be called once.
Or maybe I'm wrong and there is another way to add a component to an entity.
## Actual Behavior
"Tag added" is never printed meaning the `print_added` function is never called.
## Steps to Reproduce the Problem
1. Write a system inserting a component into an entity with insert_one or insert
1. Write a system using one of the three filter with the previous component
1. This system will not work as intented
## Specifications
- Version: 0.1.3 rev=#f7131509b94b3f70eb29be092d4fd82971f547fa
- Platform: Linux (Manjaro)
## Example
```rust
use bevy::prelude::*;
fn main() {
App::build()
.add_default_plugins()
.add_resource(PrintTimer(Timer::from_seconds(3.0, true)))
.add_startup_system(setup.system())
.add_system(add_tag_on_click.system())
.add_system(print_added.system())
.add_system(print_timed.system())
.run();
}
fn setup(mut commands: Commands, mut materials: ResMut<Assets<ColorMaterial>>) {
commands
.spawn(UiCameraComponents::default())
.spawn(ButtonComponents {
material: materials.add(Color::RED.into()),
style: Style {
size: Size::new(Val::Percent(100.0), Val::Percent(100.0)),
..Default::default()
},
..Default::default()
});
}
struct Tag;
fn add_tag_on_click(mut commands: Commands, mut query: Query<(Mutated<Interaction>, Entity)>) {
for (interaction, entity) in &mut query.iter() {
if let Interaction::Clicked = *interaction {
println!("Click on {:?}", entity);
commands.insert_one(entity, Tag);
println!("Tag inserted");
}
}
}
fn print_added(_: Added<Tag>) {
println!("Tag added");
}
struct PrintTimer(Timer);
fn print_timed(time: Res<Time>, mut timer: ResMut<PrintTimer>, mut query: Query<&Tag>) {
timer.0.tick(time.delta_seconds);
if timer.0.finished {
for (i, _) in &mut query.iter().iter().enumerate() {
println!("I'm Tag #{}", i);
}
}
}
```
|
I did a bit of digging and the problem is the two systems `add_tag_on_click` and `print_added` run on the same stage. So when the component is added, the Added system has probably already been run and on each iteration the trackers are cleared. The solution is to add `print_added` to POST_UPDATE stage and it works fine, the mistake was in my code.
However, when you insert an already existing component into an entity, it is not flagged as mutated (see `World::insert()` and `Archetype::put_dynamic`). I made a showcase of this where the expected behaviour would be to print "Tag added" on the first click and then "Tag mutated" on all other clicks but "Tag mutated" is never printed.
```rust
use bevy::prelude::{stage::POST_UPDATE, *};
fn main() {
App::build()
.add_default_plugins()
.add_startup_system(setup.system())
.add_system(add_tag_on_click.system())
.add_system_to_stage(POST_UPDATE, print_added.system())
.add_system_to_stage(POST_UPDATE, print_mutated.system())
.run();
}
fn setup(mut commands: Commands, mut materials: ResMut<Assets<ColorMaterial>>) {
commands
.spawn(UiCameraComponents::default())
.spawn(ButtonComponents {
material: materials.add(Color::RED.into()),
style: Style {
size: Size::new(Val::Percent(100.0), Val::Percent(100.0)),
..Default::default()
},
..Default::default()
});
}
struct Tag;
fn add_tag_on_click(mut commands: Commands, mut query: Query<(Mutated<Interaction>, Entity)>) {
for (interaction, entity) in &mut query.iter() {
if let Interaction::Clicked = *interaction {
println!("Click on {:?}", entity);
commands.insert_one(entity, Tag);
println!("Tag inserted");
}
}
}
fn print_added(_: Added<Tag>) {
println!("Tag added");
}
fn print_mutated(_: Mutated<Tag>) {
println!("Tag mutated");
}
```
|
2020-08-31T15:03:18Z
|
0.2
|
2020-11-05T01:51:55Z
|
9cc6368b28a2df2dff652ae1a087f74fd0362a6a
|
[
"query::tests::mutated_trackers"
] |
[
"entities::tests::entity_bits_roundtrip",
"query::tests::access_order",
"query::tests::changed_query",
"query::tests::multiple_mutated_query",
"query::tests::or_mutated_query",
"query::tests::added_queries",
"added_tracking",
"derived_bundle",
"clear",
"alias",
"build_entity",
"bad_bundle_derive",
"despawn",
"query_one",
"query_missing_component",
"query_batched",
"query_single_component",
"dynamic_components",
"remove_missing",
"query_all",
"query_sparse_component",
"random_access",
"shared_borrow",
"query_optional_component",
"spawn_batch",
"remove_tracking",
"spawn_many",
"src/entity_builder.rs - entity_builder::EntityBuilder (line 37)",
"src/world.rs - world::World::query_one_mut (line 368)",
"src/world.rs - world::World::query_one (line 341)",
"src/world.rs - world::World::spawn_batch (line 123)",
"src/lib.rs - (line 29)",
"src/world.rs - world::World::query_one_mut_unchecked (line 397)",
"src/world.rs - world::World::iter (line 474)",
"src/world.rs - world::World::spawn (line 80)",
"src/query.rs - query::Or (line 326)",
"src/world.rs - world::World::query (line 243)",
"src/world.rs - world::World::query_unchecked (line 316)",
"src/query.rs - query::QueryBorrow::with (line 769)",
"src/query.rs - query::Without (line 584)",
"src/world.rs - world::World::insert (line 503)",
"src/query.rs - query::QueryBorrow::without (line 792)",
"src/query.rs - query::With (line 649)",
"src/world.rs - world::World::query_mut (line 279)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 386
|
bevyengine__bevy-386
|
[
"352"
] |
db8ec7d55ffc966f8ee62722156aaaa3f3bb8a56
|
diff --git a/crates/bevy_transform/src/hierarchy/hierarchy.rs b/crates/bevy_transform/src/hierarchy/hierarchy.rs
--- a/crates/bevy_transform/src/hierarchy/hierarchy.rs
+++ b/crates/bevy_transform/src/hierarchy/hierarchy.rs
@@ -1,4 +1,4 @@
-use crate::components::Children;
+use crate::components::{Children, Parent};
use bevy_ecs::{Commands, Entity, Query, World, WorldWriter};
pub fn run_on_hierarchy<T, S>(
diff --git a/crates/bevy_transform/src/hierarchy/hierarchy.rs b/crates/bevy_transform/src/hierarchy/hierarchy.rs
--- a/crates/bevy_transform/src/hierarchy/hierarchy.rs
+++ b/crates/bevy_transform/src/hierarchy/hierarchy.rs
@@ -44,6 +44,18 @@ pub struct DespawnRecursive {
}
fn despawn_with_children_recursive(world: &mut World, entity: Entity) {
+ // first, make the entity's own parent forget about it
+ if let Ok(parent) = world.get::<Parent>(entity) {
+ if let Ok(mut children) = world.get_mut::<Children>(parent.0) {
+ children.retain(|c| *c != entity);
+ }
+ }
+ // then despawn the entity and all of its children
+ despawn_with_children_recursive_inner(world, entity);
+}
+
+// Should only be called by `despawn_with_children_recursive`!
+fn despawn_with_children_recursive_inner(world: &mut World, entity: Entity) {
if let Some(children) = world
.get::<Children>(entity)
.ok()
|
diff --git a/crates/bevy_transform/src/hierarchy/hierarchy.rs b/crates/bevy_transform/src/hierarchy/hierarchy.rs
--- a/crates/bevy_transform/src/hierarchy/hierarchy.rs
+++ b/crates/bevy_transform/src/hierarchy/hierarchy.rs
@@ -78,32 +90,41 @@ impl DespawnRecursiveExt for Commands {
#[cfg(test)]
mod tests {
use super::DespawnRecursiveExt;
- use crate::hierarchy::BuildChildren;
- use bevy_ecs::{Commands, Entity, Resources, World};
+ use crate::{components::Children, hierarchy::BuildChildren};
+ use bevy_ecs::{Commands, Resources, World};
#[test]
fn despawn_recursive() {
let mut world = World::default();
let mut resources = Resources::default();
let mut command_buffer = Commands::default();
- let parent_entity = Entity::new();
command_buffer.spawn((0u32, 0u64)).with_children(|parent| {
parent.spawn((0u32, 0u64));
});
- command_buffer
- .spawn_as_entity(parent_entity, (1u32, 2u64))
- .with_children(|parent| {
- parent.spawn((1u32, 2u64)).with_children(|parent| {
- parent.spawn((1u32, 2u64));
+ // Create a grandparent entity which will _not_ be deleted
+ command_buffer.spawn((1u32, 1u64));
+ let grandparent_entity = command_buffer.current_entity().unwrap();
+
+ command_buffer.with_children(|parent| {
+ // Add a child to the grandparent (the "parent"), which will get deleted
+ parent.spawn((2u32, 2u64));
+ // All descendents of the "parent" should also be deleted.
+ parent.with_children(|parent| {
+ parent.spawn((3u32, 3u64)).with_children(|parent| {
+ // child
+ parent.spawn((4u32, 4u64));
});
- parent.spawn((1u32, 2u64));
+ parent.spawn((5u32, 5u64));
});
+ });
command_buffer.spawn((0u32, 0u64));
command_buffer.apply(&mut world, &mut resources);
+ let parent_entity = world.get::<Children>(grandparent_entity).unwrap()[0];
+
command_buffer.despawn_recursive(parent_entity);
command_buffer.apply(&mut world, &mut resources);
diff --git a/crates/bevy_transform/src/hierarchy/hierarchy.rs b/crates/bevy_transform/src/hierarchy/hierarchy.rs
--- a/crates/bevy_transform/src/hierarchy/hierarchy.rs
+++ b/crates/bevy_transform/src/hierarchy/hierarchy.rs
@@ -113,8 +134,20 @@ mod tests {
.map(|(a, b)| (*a, *b))
.collect::<Vec<_>>();
+ {
+ let children = world.get::<Children>(grandparent_entity).unwrap();
+ assert_eq!(
+ children.iter().any(|&i| i == parent_entity),
+ false,
+ "grandparent should no longer know about its child which has been removed"
+ );
+ }
+
// parent_entity and its children should be deleted,
- // the (0, 0) tuples remaining.
- assert_eq!(results, vec![(0u32, 0u64), (0u32, 0u64), (0u32, 0u64)]);
+ // the grandparent tuple (1, 1) and (0, 0) tuples remaining.
+ assert_eq!(
+ results,
+ vec![(0u32, 0u64), (0u32, 0u64), (0u32, 0u64), (1u32, 1u64)]
+ );
}
}
|
Despawned Node Entities are not removed from their parent Node's Children
An entity that is despawned doesn't appear to be removed from the `Children` component of their parent Node.
I'm not sure this is a bug, but I could see it eventually effective performance for a long running game that both spawns and despawns a lot of entities within a parent and iterates over the Children object a lot.
I think this is related to #351.
**Example Reproduction**
```
use bevy::prelude::*;
/// This example illustrates how to create a button that changes color and text based on its interaction state.
fn main() {
App::build()
.add_default_plugins()
.init_resource::<ButtonMaterials>()
.init_resource::<ButtonCount>()
.add_startup_system(setup.system())
.add_system(button_system.system())
.run();
}
fn button_system(
mut commands: Commands,
button_materials: Res<ButtonMaterials>,
asset_server: Res<AssetServer>,
mut button_count: ResMut<ButtonCount>,
mut interaction_query: Query<(
Entity,
&Button,
Mutated<Interaction>,
&mut Handle<ColorMaterial>,
&Children,
)>,
mut root_query: Query<(Entity, &Root, &Children)>,
) {
for (e, _, interaction, mut material, _) in &mut interaction_query.iter() {
match *interaction {
Interaction::Clicked => {
let font = asset_server
.get_handle("assets/fonts/FiraMono-Medium.ttf")
.unwrap();
// we're going to remvoe the button
commands.despawn_recursive(e);
// spawn a new button in the same spot
for (parent, _, children) in &mut root_query.iter() {
println!("Now have: {} children", children.0.len());
let e = spawn_button_node(
&mut commands,
&button_materials,
font,
&(format!("Button {}", button_count.0))[..],
);
button_count.0 = button_count.0 + 1;
commands.push_children(parent, &[e]);
break;
}
}
Interaction::Hovered => {
*material = button_materials.hovered;
}
Interaction::None => {
*material = button_materials.normal;
}
}
}
}
fn setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
button_materials: Res<ButtonMaterials>,
) {
let font = asset_server
.load("assets/fonts/FiraMono-Medium.ttf")
.unwrap();
let root = Entity::new();
commands
.spawn(UiCameraComponents::default())
.spawn_as_entity(
root,
NodeComponents {
style: Style {
size: Size::new(Val::Percent(100.0), Val::Percent(100.0)),
flex_direction: FlexDirection::ColumnReverse,
justify_content: JustifyContent::FlexStart,
align_items: AlignItems::Center,
..Default::default()
},
..Default::default()
},
)
.with(Root);
let button = spawn_button_node(&mut commands, &button_materials, font, "First button");
commands.push_children(root, &[button]);
}
struct ButtonMaterials {
normal: Handle<ColorMaterial>,
hovered: Handle<ColorMaterial>,
pressed: Handle<ColorMaterial>,
}
impl FromResources for ButtonMaterials {
fn from_resources(resources: &Resources) -> Self {
let mut materials = resources.get_mut::<Assets<ColorMaterial>>().unwrap();
ButtonMaterials {
normal: materials.add(Color::rgb(0.02, 0.02, 0.02).into()),
hovered: materials.add(Color::rgb(0.05, 0.05, 0.05).into()),
pressed: materials.add(Color::rgb(0.1, 0.5, 0.1).into()),
}
}
}
#[derive(Default)]
struct ButtonCount(u32);
struct Root;
fn spawn_button_node(
commands: &mut Commands,
mats: &Res<ButtonMaterials>,
font: Handle<Font>,
label: &str,
) -> Entity {
let e = Entity::new();
commands
.spawn_as_entity(
e,
ButtonComponents {
style: Style {
size: Size::new(Val::Px(300.0), Val::Px(65.0)),
// center button
margin: Rect::all(Val::Auto),
// horizontally center child text
justify_content: JustifyContent::Center,
// vertically center child text
align_items: AlignItems::Center,
..Default::default()
},
material: mats.normal,
..Default::default()
},
)
.with_children(|parent| {
parent.spawn(TextComponents {
text: Text {
value: label.to_string(),
font: font,
style: TextStyle {
font_size: 28.0,
color: Color::rgb(0.8, 0.8, 0.8),
},
},
..Default::default()
});
});
e
}
```
**Result**
```
> cargo run
Now have: 1 children
Now have: 2 children
Now have: 3 children
Now have: 4 children
Now have: 5 children
Now have: 6 children
Now have: 7 children
Now have: 8 children
Now have: 9 children
Now have: 10 children
Now have: 11 children
```
My expectation is that despawned children are eventually removed from the `Parent` component. I don't expect it to be immediatey, so I wouldn't be surprised to occasionally see `3 children` in my Parent even if there's only 1 child still alive, but I do expect them to be removed eventually.
|
@karroffel or @cart This behavior is also leading to a crash if you later call `.despawn_recursive` on the entity that has the no longer existing child:
```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoSuchEntity', /Users/noah/.cargo/git/checkouts/bevy-f7ffde730c324c74/89a1d36/crates/bevy_transform/src/hierarchy/hierarchy.rs:57:27
stack backtrace:
...
7: core::panicking::panic_fmt
8: core::option::expect_none_failed
9: core::result::Result<T,E>::unwrap
**10: bevy_transform::hierarchy::hierarchy::despawn_with_children_recursive**
**11: bevy_transform::hierarchy::hierarchy::despawn_with_children_recursive**
12: <bevy_transform::hierarchy::hierarchy::DespawnRecursive as bevy_ecs::system::commands::WorldWriter>::write
13: bevy_ecs::system::commands::Commands::apply
14: <Func as bevy_ecs::system::into_system::IntoQuerySystem<(bevy_ecs::system::commands::Commands,),(Ra,Rb,Rc,Rd,Re),(A,B,C)>>::system::{{closure}}
15: <bevy_ecs::system::into_system::SystemFn<State,F,ThreadLocalF,Init,SetArchetypeAccess> as bevy_ecs::system::system::System>::run_thread_local
16: bevy_ecs::schedule::parallel_executor::ExecutorStage::run
17: bevy_ecs::schedule::parallel_executor::ParallelExecutor::run
18: bevy_app::app::App::update
...
```
This happens due to this `.unwrap()` ignoring the `NoSuchEntity` error in the result:
https://github.com/bevyengine/bevy/blob/63fd4ae33324e1720d2b473f3619cf314b7a7044/crates/bevy_transform/src/hierarchy/hierarchy.rs#L57
Would you rather incorporate the crashing behavior for spurious children into this issue, or would you rather I create a separate issue for that?
I _think_ the problem is that this function doesn't check for and remove the root `entity` from the children of its own parent. Does that sound right, @cart? I'd be willing to make a PR for this, but I'm not yet sure how to look up a parent efficiently.
https://github.com/bevyengine/bevy/blob/db8ec7d55ffc966f8ee62722156aaaa3f3bb8a56/crates/bevy_transform/src/hierarchy/hierarchy.rs#L46-L58
@CleanCut The `entity` should have a `Parent` component on it that has a reference to its parent entity
@ncallaway I should have guessed that--otherwise it would be extremely inefficient to ever discover your own parent, which would make composing transformation matrices insanely expensive! I'll take a shot at making a pull request.
|
2020-08-29T04:56:04Z
|
0.1
|
2020-09-02T02:57:34Z
|
2667c24656b74fb6d3ee17206494f990678e52b3
|
[
"hierarchy::hierarchy::tests::despawn_recursive"
] |
[
"hierarchy::child_builder::tests::build_children",
"hierarchy::child_builder::tests::push_and_insert_children",
"transform_propagate_system::test::did_propagate_command_buffer",
"local_transform_systems::test::correct_local_transformation",
"transform_systems::test::correct_world_transformation",
"hierarchy::hierarchy_maintenance_system::test::correct_children",
"transform_propagate_system::test::did_propagate"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 13,886
|
bevyengine__bevy-13886
|
[
"13885"
] |
836b6c4409fbb2a9b16a972c26de631e859a6581
|
diff --git a/crates/bevy_ecs/src/archetype.rs b/crates/bevy_ecs/src/archetype.rs
--- a/crates/bevy_ecs/src/archetype.rs
+++ b/crates/bevy_ecs/src/archetype.rs
@@ -370,6 +370,7 @@ impl Archetype {
// SAFETY: We are creating an archetype that includes this component so it must exist
let info = unsafe { components.get_info_unchecked(component_id) };
info.update_archetype_flags(&mut flags);
+ observers.update_archetype_flags(component_id, &mut flags);
archetype_components.insert(
component_id,
ArchetypeComponentInfo {
|
diff --git a/crates/bevy_ecs/src/observer/mod.rs b/crates/bevy_ecs/src/observer/mod.rs
--- a/crates/bevy_ecs/src/observer/mod.rs
+++ b/crates/bevy_ecs/src/observer/mod.rs
@@ -400,6 +400,10 @@ mod tests {
#[derive(Component)]
struct C;
+ #[derive(Component)]
+ #[component(storage = "SparseSet")]
+ struct S;
+
#[derive(Event)]
struct EventA;
diff --git a/crates/bevy_ecs/src/observer/mod.rs b/crates/bevy_ecs/src/observer/mod.rs
--- a/crates/bevy_ecs/src/observer/mod.rs
+++ b/crates/bevy_ecs/src/observer/mod.rs
@@ -444,6 +448,22 @@ mod tests {
assert_eq!(3, world.resource::<R>().0);
}
+ #[test]
+ fn observer_order_insert_remove_sparse() {
+ let mut world = World::new();
+ world.init_resource::<R>();
+
+ world.observe(|_: Trigger<OnAdd, S>, mut res: ResMut<R>| res.assert_order(0));
+ world.observe(|_: Trigger<OnInsert, S>, mut res: ResMut<R>| res.assert_order(1));
+ world.observe(|_: Trigger<OnRemove, S>, mut res: ResMut<R>| res.assert_order(2));
+
+ let mut entity = world.spawn_empty();
+ entity.insert(S);
+ entity.remove::<S>();
+ entity.flush();
+ assert_eq!(3, world.resource::<R>().0);
+ }
+
#[test]
fn observer_order_recursive() {
let mut world = World::new();
|
Observers don't trigger for Sparse components
Bevy version: 0.14.0-rc.3
`Trigger<OnAdd, C>`, `Trigger<OnUpdate, C>`, `Trigger<OnRemove, C>` don't seem to trigger if the component is Sparse, not Dense.
|
FYI @cart @james-j-obrien
|
2024-06-17T00:14:44Z
|
1.78
|
2024-06-17T15:30:12Z
|
3a04d38832fc5ed31526c83b0a19a52faf2063bd
|
[
"observer::tests::observer_order_insert_remove_sparse"
] |
[
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::map_mut",
"change_detection::tests::mut_new",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_untyped_to_reflect",
"entity::map_entities::tests::dyn_entity_mapper_object_safe",
"change_detection::tests::as_deref_mut",
"change_detection::tests::set_if_neq",
"bundle::tests::component_hook_order_spawn_despawn",
"bundle::tests::component_hook_order_insert_remove",
"entity::map_entities::tests::entity_mapper",
"entity::map_entities::tests::entity_mapper_iteration",
"entity::tests::entity_bits_roundtrip",
"bundle::tests::component_hook_order_recursive",
"entity::map_entities::tests::world_scope_reserves_generations",
"change_detection::tests::change_tick_wraparound",
"entity::tests::entity_const",
"bundle::tests::component_hook_order_recursive_multiple",
"entity::tests::entity_comparison",
"change_detection::tests::change_tick_scan",
"entity::tests::entity_display",
"change_detection::tests::change_expiration",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::test_event_iter_len_updated",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_extend_impl",
"event::tests::test_firing_empty_event",
"event::tests::test_send_events_ids",
"event::tests::test_update_drain",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::from_bits",
"identifier::tests::id_comparison",
"identifier::tests::id_construction",
"intern::tests::different_interned_content",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"label::tests::dyn_eq_object_safe",
"intern::tests::zero_sized_type",
"label::tests::dyn_hash_object_safe",
"observer::tests::observer_despawn",
"observer::tests::observer_dynamic_component",
"observer::tests::observer_dynamic_trigger",
"observer::tests::observer_entity_routing",
"observer::tests::observer_multiple_components",
"observer::tests::observer_multiple_listeners",
"observer::tests::observer_multiple_matches",
"observer::tests::observer_multiple_events",
"observer::tests::observer_no_target",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_access_extend",
"query::access::tests::read_all_access_conflicts",
"observer::tests::observer_order_insert_remove",
"query::access::tests::filtered_combined_access",
"query::builder::tests::builder_dynamic_components",
"query::builder::tests::builder_static_components",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_metadata_collision",
"query::builder::tests::builder_transmute",
"query::fetch::tests::world_query_struct_variants",
"query::builder::tests::builder_with_without_dynamic",
"query::fetch::tests::world_query_phantom_data",
"query::builder::tests::builder_or",
"query::builder::tests::builder_with_without_static",
"observer::tests::observer_order_recursive",
"observer::tests::observer_order_spawn_despawn",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::state::tests::can_transmute_empty_tuple",
"query::iter::tests::query_sorts",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"query::state::tests::can_transmute_added",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_generalize_with_option",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::iter::tests::query_sort_after_next - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::join",
"query::state::tests::join_with_get",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::tests::many_entities",
"query::tests::has_query",
"query::tests::multi_storage_query",
"query::tests::query",
"query::tests::any_query",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"query::tests::query_iter_combinations_sparse",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::insert_reflected",
"query::tests::self_conflicting_worldquery - should panic",
"query::tests::query_iter_combinations",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"schedule::condition::tests::distributive_run_if_compiles",
"query::tests::derived_worldqueries",
"schedule::set::tests::test_derive_schedule_label",
"schedule::executor::simple::skip_automatic_sync_points",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"schedule::set::tests::test_derive_system_set",
"query::tests::query_filtered_iter_combinations",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::step_never_run",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::stepping::tests::stepping_disabled",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::continue_always_run",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::step_always_run",
"schedule::stepping::tests::step_breakpoint",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::stepping::tests::waiting_always_run",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::stepping::tests::unknown_schedule",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::stepping::simple_executor",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::stepping::tests::verify_cursor",
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"storage::sparse_set::tests::sparse_set",
"schedule::tests::system_ambiguity::before_and_after",
"storage::blob_vec::tests::resize_test",
"storage::table::tests::table",
"system::builder::tests::local_builder",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"storage::sparse_set::tests::sparse_sets",
"system::commands::tests::append",
"system::builder::tests::query_builder",
"system::commands::tests::commands",
"system::builder::tests::multi_param_builder",
"schedule::tests::system_ambiguity::events",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::exclusive",
"system::commands::tests::remove_resources",
"system::commands::tests::remove_components",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::system_ambiguity::nonsend",
"system::commands::tests::remove_components_by_id",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::tests::stepping::multi_threaded_executor",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::tests::system_ordering::order_exclusive_systems",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"system::function_system::tests::into_system_type_id_consistency",
"system::system::tests::run_system_once",
"system::system::tests::non_send_resources",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::tests::conditions::system_with_condition",
"system::system::tests::run_two_systems",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"schedule::stepping::tests::step_run_if_false",
"schedule::tests::system_ambiguity::read_world",
"system::system::tests::command_processing",
"schedule::schedule::tests::configure_set_on_new_schedule",
"system::system_param::tests::system_param_const_generics",
"system::system_name::tests::test_system_name_exclusive_param",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"system::system_name::tests::test_system_name_regular_param",
"system::system_param::tests::system_param_flexibility",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::tests::system_ambiguity::correct_ambiguities",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_private_fields",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::condition::tests::multiple_run_conditions",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::system_param_field_limit",
"event::tests::test_event_iter_nth",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::schedule::tests::inserts_a_sync_point",
"system::system_registry::tests::input_values",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"schedule::set::tests::test_schedule_label",
"system::system_registry::tests::exclusive_system",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::nested_systems_with_inputs",
"system::system_registry::tests::output_values",
"system::system_param::tests::system_param_generic_bounds",
"system::tests::assert_systems",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_struct_variants",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::tests::conditions::system_conditions_and_change_detection",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::system_param::tests::non_sync_local",
"schedule::tests::system_execution::run_system",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"system::system_registry::tests::change_detection",
"system::system_registry::tests::local_variables",
"schedule::tests::system_ambiguity::read_only",
"system::tests::get_system_conflicts",
"system::system_param::tests::param_set_non_send_first",
"system::tests::long_life_test",
"system::tests::can_have_16_parameters",
"system::tests::immutable_mut_test",
"system::tests::commands_param_set",
"system::tests::any_of_and_without",
"system::tests::assert_system_does_not_conflict - should panic",
"system::system_param::tests::param_set_non_send_second",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::changed_resource_system",
"schedule::condition::tests::run_condition",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"schedule::condition::tests::run_condition_combinators",
"system::tests::convert_mut_to_immut",
"system::tests::disjoint_query_mut_system",
"system::tests::non_send_option_system",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::non_send_system",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::option_has_no_filter_with - should panic",
"query::tests::par_iter_mut_change_detection",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::pipe_change_detection",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::query_validates_world_id - should panic",
"system::tests::read_system_state",
"system::tests::panic_inside_system - should panic",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::into_iter_impl",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"system::tests::or_expanded_with_and_without_common",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::or_has_filter_with",
"schedule::schedule::tests::no_sync_chain::chain_all",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::simple_system",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::local_system",
"system::tests::or_param_set_system",
"system::tests::nonconflicting_system_resources",
"system::tests::query_is_empty",
"system::tests::query_set_system",
"schedule::tests::system_ordering::order_systems",
"system::tests::or_expanded_nested_with_and_without_common",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::removal_tracking",
"event::tests::test_events_par_iter",
"system::tests::system_state_archetype_update",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_change_detection",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::write_system_state",
"system::tests::update_archetype_component_access_works",
"tests::changed_query",
"tests::added_tracking",
"tests::add_remove_components",
"tests::added_queries",
"tests::bundle_derive",
"tests::clear_entities",
"tests::despawn_mixed_storage",
"tests::despawn_table_storage",
"tests::empty_spawn",
"system::tests::world_collections_system",
"system::tests::test_combinator_clone",
"tests::changed_trackers",
"tests::changed_trackers_sparse",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop_sparse",
"tests::exact_size_query",
"tests::duplicate_components_panic - should panic",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::filtered_query_access",
"tests::insert_overwrite_drop",
"tests::multiple_worlds_same_query_get - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::insert_or_spawn_batch_invalid",
"tests::non_send_resource",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::non_send_resource_points_to_distinct_data",
"tests::non_send_resource_panic - should panic",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::query_all",
"tests::query_filter_with",
"tests::query_all_for_each",
"tests::query_filter_with_sparse",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_with_for_each",
"tests::query_filter_with_sparse_for_each",
"tests::query_filter_without",
"tests::par_for_each_sparse",
"tests::par_for_each_dense",
"tests::query_missing_component",
"tests::query_get",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_sparse_no_match",
"tests::query_optional_component_sparse",
"tests::query_single_component",
"tests::query_single_component_for_each",
"tests::query_sparse_component",
"tests::query_optional_component_table",
"tests::random_access",
"tests::ref_and_mut_query_panic - should panic",
"tests::remove",
"tests::remove_missing",
"tests::reserve_and_spawn",
"tests::resource",
"tests::resource_scope",
"tests::remove_tracking",
"tests::reserve_entities_across_worlds",
"tests::sparse_set_add_remove_many",
"world::command_queue::test::test_command_is_send",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_queue_inner",
"world::command_queue::test::test_command_queue_inner_drop_early",
"tests::spawn_batch",
"world::command_queue::test::test_command_queue_inner_drop",
"tests::take",
"tests::test_is_archetypal_size_hints",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_compatible",
"query::tests::query_filtered_exactsizeiterator_len",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::identifier::tests::world_id_exclusive_system_param",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_mut_by_id",
"world::tests::get_resource_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iter_resources_mut",
"world::tests::iter_resources",
"world::tests::spawn_empty_bundle",
"world::tests::iterate_entities_mut",
"world::tests::panic_while_overwriting_component",
"world::tests::inspect_entity_components",
"world::tests::test_verify_unique_entities",
"world::tests::iterate_entities",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 992) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 129) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 935) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 943) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 239) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 106) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 249) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 104)",
"crates/bevy_ecs/src/component.rs - component::Component (line 139)",
"crates/bevy_ecs/src/component.rs - component::Component (line 39)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/lib.rs - (line 168)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 171)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 83)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 34)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1008)",
"crates/bevy_ecs/src/component.rs - component::Component (line 85)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 647)",
"crates/bevy_ecs/src/lib.rs - (line 290)",
"crates/bevy_ecs/src/lib.rs - (line 215)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 60)",
"crates/bevy_ecs/src/lib.rs - (line 242)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 752)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 544)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 98)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 122)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 222)",
"crates/bevy_ecs/src/lib.rs - (line 192)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper::mappings (line 88)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 36)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1208)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 197)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1194)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 266) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 214) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 412) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 236) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 431) - compile fail",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 379) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 184) - compile fail",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 31)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 101)",
"crates/bevy_ecs/src/label.rs - label::define_label (line 65)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 27)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 180)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 726)",
"crates/bevy_ecs/src/lib.rs - (line 257)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 65)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 221)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 735)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 9)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 631)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 207)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 200)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 103)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 204)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 777)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 113)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1648)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 58)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 85)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 671)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 598)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 37)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 568)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 764)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::ManualEventReader (line 126)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 871)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1625)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 668)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 156)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 244)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 252)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 103)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 170)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 203)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 142)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 126)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 295) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1049)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 219)",
"crates/bevy_ecs/src/lib.rs - (line 316)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 188)",
"crates/bevy_ecs/src/lib.rs - (line 341)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 82)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 743)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 333)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 621)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 138)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 123)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 625)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 1002)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 335)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 152)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 288)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 718)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 587)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 903)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 548)",
"crates/bevy_ecs/src/lib.rs - (line 127)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 133)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 144)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1001) - compile",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 890) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 488)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 453)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1328)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 526)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 189)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 507)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 101)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 228)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 356)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 772)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 242)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 460) - compile fail",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 265)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1544) - compile fail",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 471)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1520)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 958)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 40)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 833)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 721)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 282)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemBuilder (line 12)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 42)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 870)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 311)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::add (line 1087)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 370)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 423)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 555)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 246)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::remove (line 1004)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 144)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 182)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_one_shot_system (line 666)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 147)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 233)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 559)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 822)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 114)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 608)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1263)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1228)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 465)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::despawn (line 1064)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 624)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 262)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 581)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 905)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1551)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::retain (line 1110)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1110)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1508)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert (line 958)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 455)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 240)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 114) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 417)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 775)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 616)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1157)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 260)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 943)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 319)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 60)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 47)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 785)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1187)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1082)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 777)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1395)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1306)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 348)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 227)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 383)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 752)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 181)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 76)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 431)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1383)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 897)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 195)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1481)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1330)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 269)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 222)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 27)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 198)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1455)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1738)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 2114)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1599)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1195)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 304)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 257)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2337)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1566)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2694)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 446)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 364)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1511)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1844)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 457)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 531)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1054)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1129)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1683)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1033)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1226)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1159)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 566)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1540)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1659)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 825)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1086)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 883)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1763)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1706)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 601)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1626)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 916)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 330)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2359)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 736)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 2436)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 403)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 412)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 794)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1007)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 688)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1732)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 13,848
|
bevyengine__bevy-13848
|
[
"13844"
] |
2cffd14923c9e217dc98881af6c8926fe4dc65ea
|
diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs
--- a/crates/bevy_state/src/app.rs
+++ b/crates/bevy_state/src/app.rs
@@ -4,6 +4,7 @@ use bevy_ecs::{
schedule::{IntoSystemConfigs, ScheduleLabel},
world::FromWorld,
};
+use bevy_utils::tracing::warn;
use crate::state::{
setup_state_transitions_in_world, ComputedStates, FreelyMutableState, NextState, State,
diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs
--- a/crates/bevy_state/src/app.rs
+++ b/crates/bevy_state/src/app.rs
@@ -70,6 +71,9 @@ impl AppExtStates for SubApp {
exited: None,
entered: Some(state),
});
+ } else {
+ let name = std::any::type_name::<S>();
+ warn!("State {} is already initialized.", name);
}
self
diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs
--- a/crates/bevy_state/src/app.rs
+++ b/crates/bevy_state/src/app.rs
@@ -87,6 +91,16 @@ impl AppExtStates for SubApp {
exited: None,
entered: Some(state),
});
+ } else {
+ // Overwrite previous state and initial event
+ self.insert_resource::<State<S>>(State::new(state.clone()));
+ self.world_mut()
+ .resource_mut::<Events<StateTransitionEvent<S>>>()
+ .clear();
+ self.world_mut().send_event(StateTransitionEvent {
+ exited: None,
+ entered: Some(state),
+ });
}
self
diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs
--- a/crates/bevy_state/src/app.rs
+++ b/crates/bevy_state/src/app.rs
@@ -109,6 +123,9 @@ impl AppExtStates for SubApp {
exited: None,
entered: state,
});
+ } else {
+ let name = std::any::type_name::<S>();
+ warn!("Computed state {} is already initialized.", name);
}
self
diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs
--- a/crates/bevy_state/src/app.rs
+++ b/crates/bevy_state/src/app.rs
@@ -132,6 +149,9 @@ impl AppExtStates for SubApp {
exited: None,
entered: state,
});
+ } else {
+ let name = std::any::type_name::<S>();
+ warn!("Sub state {} is already initialized.", name);
}
self
|
diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs
--- a/crates/bevy_state/src/app.rs
+++ b/crates/bevy_state/src/app.rs
@@ -192,3 +212,62 @@ impl Plugin for StatesPlugin {
schedule.insert_after(PreUpdate, StateTransition);
}
}
+
+#[cfg(test)]
+mod tests {
+ use crate::{
+ self as bevy_state,
+ state::{State, StateTransition, StateTransitionEvent},
+ };
+ use bevy_app::App;
+ use bevy_ecs::event::Events;
+ use bevy_state_macros::States;
+
+ use super::AppExtStates;
+
+ #[derive(States, Default, PartialEq, Eq, Hash, Debug, Clone)]
+ enum TestState {
+ #[default]
+ A,
+ B,
+ C,
+ }
+
+ #[test]
+ fn insert_state_can_overwrite_init_state() {
+ let mut app = App::new();
+
+ app.init_state::<TestState>();
+ app.insert_state(TestState::B);
+
+ let world = app.world_mut();
+ world.run_schedule(StateTransition);
+
+ assert_eq!(world.resource::<State<TestState>>().0, TestState::B);
+ let events = world.resource::<Events<StateTransitionEvent<TestState>>>();
+ assert_eq!(events.len(), 1);
+ let mut reader = events.get_reader();
+ let last = reader.read(events).last().unwrap();
+ assert_eq!(last.exited, None);
+ assert_eq!(last.entered, Some(TestState::B));
+ }
+
+ #[test]
+ fn insert_state_can_overwrite_insert_state() {
+ let mut app = App::new();
+
+ app.insert_state(TestState::B);
+ app.insert_state(TestState::C);
+
+ let world = app.world_mut();
+ world.run_schedule(StateTransition);
+
+ assert_eq!(world.resource::<State<TestState>>().0, TestState::C);
+ let events = world.resource::<Events<StateTransitionEvent<TestState>>>();
+ assert_eq!(events.len(), 1);
+ let mut reader = events.get_reader();
+ let last = reader.read(events).last().unwrap();
+ assert_eq!(last.exited, None);
+ assert_eq!(last.entered, Some(TestState::C));
+ }
+}
|
OnEnter triggers twice and OnExit is not triggered
## Bevy version
0.13.2
## \[Optional\] Relevant system information
Ubuntu 22.04.4 LTS 64-bit
## Minimal project with the issue
```rust
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.insert_state(AppState::A)
.insert_state(AppState::B)
.add_systems(OnEnter(AppState::A), setup_a)
.add_systems(OnEnter(AppState::B), setup_b)
.add_systems(OnExit(AppState::A), cleanup_a)
.add_systems(OnExit(AppState::B), cleanup_b)
.run();
}
#[derive(States, Debug, Clone, PartialEq, Eq, Hash)]
enum AppState {
A,
B,
}
fn setup_a() {
info!("setting up A");
}
fn setup_b() {
info!("setting up B");
}
fn cleanup_a() {
info!("cleaning up A");
}
fn cleanup_b() {
info!("cleaning up B");
}
```
## The Output
```
2024-06-14T14:30:43.872719Z INFO minimalstateissue: setting up B
2024-06-14T14:30:43.872759Z INFO minimalstateissue: setting up B
```
## Expected Output
```
2024-06-14T14:30:43.872719Z INFO minimalstateissue: setting up A
2024-06-14T14:30:43.872719Z INFO minimalstateissue: cleaning up A
2024-06-14T14:30:43.872759Z INFO minimalstateissue: setting up B
```
OR
```
2024-06-14T14:30:43.872759Z INFO minimalstateissue: setting up B
```
depending on the intended behaviour (I can say that what happens now is not intended behaviour).
|
2024-06-14T16:17:31Z
|
1.78
|
2024-09-07T19:14:04Z
|
3a04d38832fc5ed31526c83b0a19a52faf2063bd
|
[
"app::tests::insert_state_can_overwrite_insert_state",
"app::tests::insert_state_can_overwrite_init_state"
] |
[
"condition::tests::distributive_run_if_compiles",
"state::tests::same_state_transition_should_emit_event_and_not_run_schedules",
"state::tests::computed_state_with_a_single_source_is_correctly_derived",
"state::tests::sub_state_exists_only_when_allowed_but_can_be_modified_freely",
"state::tests::same_state_transition_should_propagate_to_computed_state",
"state::tests::same_state_transition_should_propagate_to_sub_state",
"state::tests::complex_computed_state_gets_derived_correctly",
"state::tests::substate_of_computed_states_works_appropriately",
"state::tests::computed_state_transitions_are_produced_correctly",
"state::tests::check_transition_orders",
"crates/bevy_state/src/state/computed_states.rs - state::computed_states::ComputedStates (line 54)",
"crates/bevy_state/src/state/transitions.rs - state::transitions::StateTransition (line 46)",
"crates/bevy_state/src/state/sub_states.rs - state::sub_states::SubStates (line 12)",
"crates/bevy_state/src/state/sub_states.rs - state::sub_states::SubStates (line 36)",
"crates/bevy_state/src/state/resources.rs - state::resources::NextState (line 98)",
"crates/bevy_state/src/state/computed_states.rs - state::computed_states::ComputedStates (line 15)",
"crates/bevy_state/src/state/sub_states.rs - state::sub_states::SubStates (line 56)",
"crates/bevy_state/src/state/resources.rs - state::resources::State (line 26)",
"crates/bevy_state/src/state/sub_states.rs - state::sub_states::SubStates (line 100)",
"crates/bevy_state/src/state_scoped.rs - state_scoped::StateScoped (line 20)",
"crates/bevy_state/src/condition.rs - condition::state_changed (line 127)",
"crates/bevy_state/src/condition.rs - condition::state_exists (line 11)",
"crates/bevy_state/src/condition.rs - condition::in_state (line 57)",
"crates/bevy_state/src/state/states.rs - state::states::States (line 22)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 13,817
|
bevyengine__bevy-13817
|
[
"13815"
] |
2825ac8a8e69b4c816e3ca67df2f841904ac7b69
|
diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs
--- a/crates/bevy_app/src/app.rs
+++ b/crates/bevy_app/src/app.rs
@@ -439,12 +439,7 @@ impl App {
plugin: Box<dyn Plugin>,
) -> Result<&mut Self, AppError> {
debug!("added plugin: {}", plugin.name());
- if plugin.is_unique()
- && !self
- .main_mut()
- .plugin_names
- .insert(plugin.name().to_string())
- {
+ if plugin.is_unique() && self.main_mut().plugin_names.contains(plugin.name()) {
Err(AppError::DuplicatePlugin {
plugin_name: plugin.name().to_string(),
})?;
diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs
--- a/crates/bevy_app/src/app.rs
+++ b/crates/bevy_app/src/app.rs
@@ -459,6 +454,9 @@ impl App {
self.main_mut().plugin_build_depth += 1;
let result = catch_unwind(AssertUnwindSafe(|| plugin.build(self)));
+ self.main_mut()
+ .plugin_names
+ .insert(plugin.name().to_string());
self.main_mut().plugin_build_depth -= 1;
if let Err(payload) = result {
|
diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs
--- a/crates/bevy_app/src/app.rs
+++ b/crates/bevy_app/src/app.rs
@@ -1275,6 +1273,21 @@ mod tests {
.init_resource::<TestResource>();
}
+ #[test]
+ /// Plugin should not be considered inserted while it's being built
+ ///
+ /// bug: <https://github.com/bevyengine/bevy/issues/13815>
+ fn plugin_should_not_be_added_during_build_time() {
+ pub struct Foo;
+
+ impl Plugin for Foo {
+ fn build(&self, app: &mut App) {
+ assert!(!app.is_plugin_added::<Self>());
+ }
+ }
+
+ App::new().add_plugins(Foo);
+ }
#[test]
fn events_should_be_updated_once_per_update() {
#[derive(Event, Clone)]
|
is_plugin_added is always true for Self
## Bevy version
0.14.0-rc.2
## What you did
The following program panics in Bevy 0.14.0-rc.2, but runs successfully in 0.13.2
```rust
use bevy::prelude::*;
fn main() {
let app = App::new().add_plugins(Foo);
}
pub struct Foo;
impl Plugin for Foo {
fn build(&self, app: &mut App) {
if app.is_plugin_added::<Self>() {
panic!()
}
}
}
```
## What went wrong
Either the previous behavior should be restored, or we should document it in the migration guide.
## Additional information
|
2024-06-11T22:18:39Z
|
1.78
|
2024-06-14T19:51:44Z
|
3a04d38832fc5ed31526c83b0a19a52faf2063bd
|
[
"app::tests::plugin_should_not_be_added_during_build_time"
] |
[
"app::tests::app_exit_size",
"app::tests::test_derive_app_label",
"plugin_group::tests::add_after",
"app::tests::initializing_resources_from_world",
"app::tests::can_add_two_plugins",
"app::tests::can_add_twice_the_same_plugin_with_different_type_param",
"app::tests::can_add_twice_the_same_plugin_not_unique",
"plugin_group::tests::add_before",
"plugin_group::tests::add_conflicting_subgroup",
"plugin_group::tests::add_basic_subgroup",
"app::tests::cant_call_app_run_from_plugin_build - should panic",
"app::tests::cant_add_twice_the_same_plugin - should panic",
"plugin_group::tests::basic_ordering",
"app::tests::add_systems_should_create_schedule_if_it_does_not_exist",
"plugin_group::tests::readd",
"plugin_group::tests::readd_after",
"plugin_group::tests::readd_before",
"app::tests::test_is_plugin_added_works_during_finish - should panic",
"app::tests::test_extract_sees_changes",
"app::tests::events_should_be_updated_once_per_update",
"app::tests::runner_returns_correct_exit_code",
"app::tests::regression_test_10385",
"app::tests::test_update_clears_trackers_once",
"crates/bevy_app/src/panic_handler.rs - panic_handler::PanicHandlerPlugin (line 18) - compile",
"crates/bevy_app/src/panic_handler.rs - panic_handler::PanicHandlerPlugin (line 30) - compile",
"crates/bevy_app/src/plugin.rs - plugin::Plugin (line 42)",
"crates/bevy_app/src/plugin.rs - plugin::Plugin (line 29)",
"crates/bevy_app/src/app.rs - app::App::insert_non_send_resource (line 411)",
"crates/bevy_app/src/app.rs - app::App (line 56)",
"crates/bevy_app/src/plugin_group.rs - plugin_group::NoopPluginGroup (line 229)",
"crates/bevy_app/src/app.rs - app::App::set_runner (line 183)",
"crates/bevy_app/src/app.rs - app::App::add_event (line 327)",
"crates/bevy_app/src/app.rs - app::App::init_resource (line 378)",
"crates/bevy_app/src/sub_app.rs - sub_app::SubApp (line 23)",
"crates/bevy_app/src/app.rs - app::App::add_systems (line 271)",
"crates/bevy_app/src/app.rs - app::App::insert_resource (line 352)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 13,706
|
bevyengine__bevy-13706
|
[
"13646"
] |
b17292f9d11cf3d3fb4a2fb3e3324fb80afd8c88
|
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -197,12 +197,26 @@ impl MapInfo {
#[macro_export]
macro_rules! hash_error {
( $key:expr ) => {{
- let type_name = match (*$key).get_represented_type_info() {
- None => "Unknown",
- Some(s) => s.type_path(),
- };
- format!("the given key {} does not support hashing", type_name).as_str()
- }};
+ let type_path = (*$key).reflect_type_path();
+ if !$key.is_dynamic() {
+ format!(
+ "the given key of type `{}` does not support hashing",
+ type_path
+ )
+ } else {
+ match (*$key).get_represented_type_info() {
+ // Handle dynamic types that do not represent a type (i.e a plain `DynamicStruct`):
+ None => format!("the dynamic type `{}` does not support hashing", type_path),
+ // Handle dynamic types that do represent a type (i.e. a `DynamicStruct` proxying `Foo`):
+ Some(s) => format!(
+ "the dynamic type `{}` (representing `{}`) does not support hashing",
+ type_path,
+ s.type_path()
+ ),
+ }
+ }
+ .as_str()
+ }}
}
/// An ordered mapping between reflected values.
|
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -596,6 +596,7 @@ mod tests {
any::TypeId,
borrow::Cow,
fmt::{Debug, Formatter},
+ hash::Hash,
marker::PhantomData,
};
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -756,7 +757,9 @@ mod tests {
}
#[test]
- #[should_panic(expected = "the given key bevy_reflect::tests::Foo does not support hashing")]
+ #[should_panic(
+ expected = "the given key of type `bevy_reflect::tests::Foo` does not support hashing"
+ )]
fn reflect_map_no_hash() {
#[derive(Reflect)]
struct Foo {
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -764,11 +767,50 @@ mod tests {
}
let foo = Foo { a: 1 };
+ assert!(foo.reflect_hash().is_none());
let mut map = DynamicMap::default();
map.insert(foo, 10u32);
}
+ #[test]
+ #[should_panic(
+ expected = "the dynamic type `bevy_reflect::DynamicStruct` (representing `bevy_reflect::tests::Foo`) does not support hashing"
+ )]
+ fn reflect_map_no_hash_dynamic_representing() {
+ #[derive(Reflect, Hash)]
+ #[reflect(Hash)]
+ struct Foo {
+ a: u32,
+ }
+
+ let foo = Foo { a: 1 };
+ assert!(foo.reflect_hash().is_some());
+ let dynamic = foo.clone_dynamic();
+
+ let mut map = DynamicMap::default();
+ map.insert(dynamic, 11u32);
+ }
+
+ #[test]
+ #[should_panic(
+ expected = "the dynamic type `bevy_reflect::DynamicStruct` does not support hashing"
+ )]
+ fn reflect_map_no_hash_dynamic() {
+ #[derive(Reflect, Hash)]
+ #[reflect(Hash)]
+ struct Foo {
+ a: u32,
+ }
+
+ let mut dynamic = DynamicStruct::default();
+ dynamic.insert("a", 4u32);
+ assert!(dynamic.reflect_hash().is_none());
+
+ let mut map = DynamicMap::default();
+ map.insert(dynamic, 11u32);
+ }
+
#[test]
fn reflect_ignore() {
#[derive(Reflect)]
|
Panic "the given key does not support hashing" should indicate the type.
The reflection panic "the given key does not support hashing" raised by insert_boxed needs to indicate the type that it is trying to use as a key. Otherwise, it is difficult to track down the source of the panic.
|
Hi, Im new to rust and bevy, in this particular issue I managed to figure that we need the debug msg to be more descriptive. However I cant seem what exactly keeps track of the type. Any advice?
|
2024-06-06T07:36:57Z
|
1.78
|
2024-06-10T12:20:23Z
|
3a04d38832fc5ed31526c83b0a19a52faf2063bd
|
[
"tests::reflect_map_no_hash - should panic",
"tests::reflect_map_no_hash_dynamic - should panic",
"tests::reflect_map_no_hash_dynamic_representing - should panic"
] |
[
"array::tests::next_index_increment",
"attributes::tests::should_allow_unit_struct_attribute_values",
"attributes::tests::should_accept_last_attribute",
"attributes::tests::should_debug_custom_attributes",
"attributes::tests::should_derive_custom_attributes_on_enum_container",
"attributes::tests::should_derive_custom_attributes_on_enum_variant_fields",
"attributes::tests::should_derive_custom_attributes_on_struct_container",
"attributes::tests::should_derive_custom_attributes_on_struct_fields",
"attributes::tests::should_derive_custom_attributes_on_tuple_container",
"attributes::tests::should_derive_custom_attributes_on_enum_variants",
"attributes::tests::should_derive_custom_attributes_on_tuple_struct_fields",
"attributes::tests::should_get_custom_attribute",
"attributes::tests::should_get_custom_attribute_dynamically",
"enums::enum_trait::tests::next_index_increment",
"enums::tests::applying_non_enum_should_panic - should panic",
"enums::tests::dynamic_enum_should_apply_dynamic_enum",
"enums::tests::dynamic_enum_should_set_variant_fields",
"enums::tests::dynamic_enum_should_change_variant",
"enums::tests::enum_should_allow_nesting_enums",
"enums::tests::enum_should_allow_generics",
"enums::tests::enum_should_allow_struct_fields",
"enums::tests::enum_should_apply",
"enums::tests::enum_should_iterate_fields",
"enums::tests::enum_should_partial_eq",
"enums::tests::enum_should_return_correct_variant_path",
"enums::tests::enum_should_return_correct_variant_type",
"enums::tests::enum_try_apply_should_detect_type_mismatch",
"enums::tests::enum_should_set",
"enums::tests::partial_dynamic_enum_should_set_variant_fields",
"enums::tests::should_get_enum_type_info",
"impls::smol_str::tests::should_partial_eq_smolstr",
"enums::tests::should_skip_ignored_fields",
"impls::smol_str::tests::smolstr_should_from_reflect",
"impls::std::tests::instant_should_from_reflect",
"impls::std::tests::nonzero_usize_impl_reflect_from_reflect",
"impls::std::tests::option_should_apply",
"impls::std::tests::option_should_from_reflect",
"impls::std::tests::option_should_impl_enum",
"impls::std::tests::path_should_from_reflect",
"impls::std::tests::can_serialize_duration",
"impls::std::tests::option_should_impl_typed",
"impls::std::tests::should_partial_eq_btree_map",
"impls::std::tests::should_partial_eq_char",
"impls::std::tests::should_partial_eq_f32",
"impls::std::tests::should_partial_eq_hash_map",
"impls::std::tests::should_partial_eq_i32",
"impls::std::tests::should_partial_eq_option",
"impls::std::tests::should_partial_eq_string",
"impls::std::tests::should_partial_eq_vec",
"impls::std::tests::static_str_should_from_reflect",
"impls::std::tests::type_id_should_from_reflect",
"list::tests::next_index_increment",
"list::tests::test_into_iter",
"map::tests::next_index_increment",
"map::tests::test_into_iter",
"map::tests::test_map_get_at",
"map::tests::test_map_get_at_mut",
"path::parse::test::parse_invalid",
"path::tests::accept_leading_tokens",
"path::tests::parsed_path_parse",
"path::tests::reflect_array_behaves_like_list",
"path::tests::reflect_array_behaves_like_list_mut",
"path::tests::parsed_path_get_field",
"path::tests::reflect_path",
"serde::de::tests::should_deserialize_value",
"tests::as_reflect",
"tests::assert_impl_reflect_macro_on_all",
"serde::ser::tests::enum_should_serialize",
"serde::de::tests::should_deserialized_typed",
"serde::ser::tests::should_serialize_dynamic_option",
"struct_trait::tests::next_index_increment",
"tests::custom_debug_function",
"serde::de::tests::enum_should_deserialize",
"tests::docstrings::should_not_contain_docs",
"serde::tests::should_not_serialize_unproxied_dynamic - should panic",
"serde::ser::tests::should_serialize_non_self_describing_binary",
"serde::ser::tests::should_serialize_self_describing_binary",
"serde::ser::tests::should_serialize",
"tests::docstrings::variants_should_contain_docs",
"tests::from_reflect_should_use_default_variant_field_attributes",
"tests::docstrings::fields_should_contain_docs",
"tests::from_reflect_should_use_default_field_attributes",
"serde::ser::tests::should_serialize_option",
"tests::from_reflect_should_use_default_container_attribute",
"serde::de::tests::should_deserialize_non_self_describing_binary",
"tests::docstrings::should_contain_docs",
"tests::glam::vec3_apply_dynamic",
"serde::tests::test_serialization_struct",
"tests::from_reflect_should_allow_ignored_unnamed_fields",
"serde::de::tests::should_deserialize_option",
"serde::tests::should_roundtrip_proxied_dynamic",
"tests::can_opt_out_type_path",
"tests::glam::vec3_field_access",
"tests::into_reflect",
"tests::glam::vec3_path_access",
"tests::dynamic_types_debug_format",
"tests::multiple_reflect_lists",
"tests::reflect_downcast",
"serde::tests::test_serialization_tuple_struct",
"tests::multiple_reflect_value_lists",
"tests::recursive_typed_storage_does_not_hang",
"tests::glam::quat_serialization",
"serde::de::tests::should_deserialize_self_describing_binary",
"tests::glam::vec3_deserialization",
"tests::reflect_ignore",
"serde::de::tests::should_deserialize",
"tests::reflect_complex_patch",
"tests::not_dynamic_names",
"serde::de::tests::should_reserialize",
"tests::reflect_map",
"tests::recursive_registration_does_not_hang",
"tests::glam::quat_deserialization",
"tests::reflect_take",
"tests::glam::vec3_serialization",
"tests::reflect_struct",
"tests::reflect_type_path",
"tests::reflect_unit_struct",
"tests::should_allow_custom_where",
"tests::should_allow_custom_where_with_assoc_type",
"tests::should_allow_dynamic_fields",
"tests::reflect_type_info",
"tests::should_allow_empty_custom_where",
"tests::should_allow_multiple_custom_where",
"tests::should_drain_fields",
"tests::should_permit_higher_ranked_lifetimes",
"tests::should_not_auto_register_existing_types",
"tests::should_permit_valid_represented_type_for_dynamic",
"tests::should_call_from_reflect_dynamically",
"tests::should_prohibit_invalid_represented_type_for_dynamic - should panic",
"tests::try_apply_should_detect_kinds",
"tests::std_type_paths",
"tests::should_auto_register_fields",
"tuple_struct::tests::next_index_increment",
"tests::should_reflect_debug",
"tests::reflect_serialize",
"type_registry::test::test_reflect_from_ptr",
"tuple::tests::next_index_increment",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Struct (line 43)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Unit (line 30)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Tuple (line 22)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Struct (line 12)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Unit (line 61)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Tuple (line 53)",
"crates/bevy_reflect/src/utility.rs - utility::NonGenericTypeCell (line 50)",
"crates/bevy_reflect/src/lib.rs - (line 296)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 171)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 131)",
"crates/bevy_reflect/src/type_info.rs - type_info::Typed (line 26)",
"crates/bevy_reflect/src/lib.rs - (line 39)",
"crates/bevy_reflect/src/type_path.rs - type_path::TypePath (line 39)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::GetTupleStructField (line 189)",
"crates/bevy_reflect/src/lib.rs - (line 142)",
"crates/bevy_reflect/src/tuple.rs - tuple::GetTupleField (line 95)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 339)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 315)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::struct_debug (line 546)",
"crates/bevy_reflect/src/lib.rs - (line 177)",
"crates/bevy_reflect/src/lib.rs - (line 85)",
"crates/bevy_reflect/src/lib.rs - (line 156)",
"crates/bevy_reflect/src/lib.rs - (line 106)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::Struct (line 27)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 159)",
"crates/bevy_reflect/src/array.rs - array::array_debug (line 484)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 61)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::TupleStruct (line 23)",
"crates/bevy_reflect/src/enums/dynamic_enum.rs - enums::dynamic_enum::DynamicEnum (line 54)",
"crates/bevy_reflect/src/lib.rs - (line 314)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::is_ambiguous (line 348)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 181)",
"crates/bevy_reflect/src/list.rs - list::List (line 37)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 81)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 211)",
"crates/bevy_reflect/src/attributes.rs - attributes::CustomAttributes (line 15)",
"crates/bevy_reflect/src/lib.rs - (line 191)",
"crates/bevy_reflect/src/serde/type_data.rs - serde::type_data::SerializationData::is_field_skipped (line 29)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 145)",
"crates/bevy_reflect/src/map.rs - map::Map (line 28)",
"crates/bevy_reflect/src/lib.rs - (line 275)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistration (line 451)",
"crates/bevy_reflect/src/array.rs - array::Array (line 30)",
"crates/bevy_reflect/src/list.rs - list::list_debug (line 510)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::ReflectFromPtr (line 651)",
"crates/bevy_reflect/src/tuple.rs - tuple::Tuple (line 24)",
"crates/bevy_reflect/src/serde/type_data.rs - serde::type_data::SerializationData::generate_default (line 69)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register (line 127)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 327)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::GetField (line 238)",
"crates/bevy_reflect/src/tuple.rs - tuple::tuple_debug (line 461)",
"crates/bevy_reflect/src/serde/ser.rs - serde::ser::ReflectSerializer (line 67)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 122)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::tuple_struct_debug (line 462)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register_type_data (line 250)",
"crates/bevy_reflect/src/lib.rs - (line 247)",
"crates/bevy_reflect/src/serde/ser.rs - serde::ser::TypedReflectSerializer (line 145)",
"crates/bevy_reflect/src/enums/helpers.rs - enums::helpers::enum_debug (line 82)",
"crates/bevy_reflect/src/lib.rs - (line 216)",
"crates/bevy_reflect/src/serde/de.rs - serde::de::ReflectDeserializer (line 320)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath::parse (line 373)",
"crates/bevy_reflect/src/serde/de.rs - serde::de::TypedReflectDeserializer (line 453)",
"crates/bevy_reflect/src/lib.rs - (line 357)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 13,691
|
bevyengine__bevy-13691
|
[
"13646"
] |
519abbca1141bf904695b1c0cf4184addc6883c5
|
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -194,7 +194,16 @@ impl MapInfo {
}
}
-const HASH_ERROR: &str = "the given key does not support hashing";
+#[macro_export]
+macro_rules! hash_error {
+ ( $key:expr ) => {{
+ let type_name = match (*$key).get_represented_type_info() {
+ None => "Unknown",
+ Some(s) => s.type_path(),
+ };
+ format!("the given key {} does not support hashing", type_name).as_str()
+ }};
+}
/// An ordered mapping between reflected values.
#[derive(Default)]
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -233,13 +242,13 @@ impl DynamicMap {
impl Map for DynamicMap {
fn get(&self, key: &dyn Reflect) -> Option<&dyn Reflect> {
self.indices
- .get(&key.reflect_hash().expect(HASH_ERROR))
+ .get(&key.reflect_hash().expect(hash_error!(key)))
.map(|index| &*self.values.get(*index).unwrap().1)
}
fn get_mut(&mut self, key: &dyn Reflect) -> Option<&mut dyn Reflect> {
self.indices
- .get(&key.reflect_hash().expect(HASH_ERROR))
+ .get(&key.reflect_hash().expect(hash_error!(key)))
.cloned()
.map(move |index| &mut *self.values.get_mut(index).unwrap().1)
}
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -285,7 +294,10 @@ impl Map for DynamicMap {
key: Box<dyn Reflect>,
mut value: Box<dyn Reflect>,
) -> Option<Box<dyn Reflect>> {
- match self.indices.entry(key.reflect_hash().expect(HASH_ERROR)) {
+ match self
+ .indices
+ .entry(key.reflect_hash().expect(hash_error!(key)))
+ {
Entry::Occupied(entry) => {
let (_old_key, old_value) = self.values.get_mut(*entry.get()).unwrap();
std::mem::swap(old_value, &mut value);
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -302,7 +314,7 @@ impl Map for DynamicMap {
fn remove(&mut self, key: &dyn Reflect) -> Option<Box<dyn Reflect>> {
let index = self
.indices
- .remove(&key.reflect_hash().expect(HASH_ERROR))?;
+ .remove(&key.reflect_hash().expect(hash_error!(key)))?;
let (_key, value) = self.values.remove(index);
Some(value)
}
|
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -756,7 +756,7 @@ mod tests {
}
#[test]
- #[should_panic(expected = "the given key does not support hashing")]
+ #[should_panic(expected = "the given key bevy_reflect::tests::Foo does not support hashing")]
fn reflect_map_no_hash() {
#[derive(Reflect)]
struct Foo {
|
Panic "the given key does not support hashing" should indicate the type.
The reflection panic "the given key does not support hashing" raised by insert_boxed needs to indicate the type that it is trying to use as a key. Otherwise, it is difficult to track down the source of the panic.
|
Hi, Im new to rust and bevy, in this particular issue I managed to figure that we need the debug msg to be more descriptive. However I cant seem what exactly keeps track of the type. Any advice?
|
2024-06-05T19:05:50Z
|
1.78
|
2024-06-06T15:08:29Z
|
3a04d38832fc5ed31526c83b0a19a52faf2063bd
|
[
"tests::reflect_map_no_hash - should panic"
] |
[
"array::tests::next_index_increment",
"attributes::tests::should_allow_unit_struct_attribute_values",
"attributes::tests::should_debug_custom_attributes",
"attributes::tests::should_accept_last_attribute",
"attributes::tests::should_derive_custom_attributes_on_enum_variant_fields",
"attributes::tests::should_derive_custom_attributes_on_enum_container",
"attributes::tests::should_derive_custom_attributes_on_enum_variants",
"attributes::tests::should_derive_custom_attributes_on_struct_fields",
"attributes::tests::should_derive_custom_attributes_on_struct_container",
"attributes::tests::should_derive_custom_attributes_on_tuple_container",
"attributes::tests::should_derive_custom_attributes_on_tuple_struct_fields",
"attributes::tests::should_get_custom_attribute",
"attributes::tests::should_get_custom_attribute_dynamically",
"enums::enum_trait::tests::next_index_increment",
"enums::tests::dynamic_enum_should_apply_dynamic_enum",
"enums::tests::applying_non_enum_should_panic - should panic",
"enums::tests::dynamic_enum_should_change_variant",
"enums::tests::dynamic_enum_should_set_variant_fields",
"enums::tests::enum_should_allow_nesting_enums",
"enums::tests::enum_should_allow_struct_fields",
"enums::tests::enum_should_apply",
"enums::tests::enum_should_allow_generics",
"enums::tests::enum_should_iterate_fields",
"enums::tests::enum_should_partial_eq",
"enums::tests::enum_should_return_correct_variant_path",
"enums::tests::enum_should_return_correct_variant_type",
"enums::tests::enum_should_set",
"enums::tests::enum_try_apply_should_detect_type_mismatch",
"enums::tests::partial_dynamic_enum_should_set_variant_fields",
"enums::tests::should_get_enum_type_info",
"enums::tests::should_skip_ignored_fields",
"impls::smol_str::tests::should_partial_eq_smolstr",
"impls::smol_str::tests::smolstr_should_from_reflect",
"impls::std::tests::instant_should_from_reflect",
"impls::std::tests::nonzero_usize_impl_reflect_from_reflect",
"impls::std::tests::option_should_apply",
"impls::std::tests::option_should_from_reflect",
"impls::std::tests::option_should_impl_enum",
"impls::std::tests::path_should_from_reflect",
"impls::std::tests::option_should_impl_typed",
"impls::std::tests::can_serialize_duration",
"impls::std::tests::should_partial_eq_char",
"impls::std::tests::should_partial_eq_btree_map",
"impls::std::tests::should_partial_eq_f32",
"impls::std::tests::should_partial_eq_hash_map",
"impls::std::tests::should_partial_eq_i32",
"impls::std::tests::should_partial_eq_option",
"impls::std::tests::should_partial_eq_string",
"impls::std::tests::should_partial_eq_vec",
"impls::std::tests::static_str_should_from_reflect",
"impls::std::tests::type_id_should_from_reflect",
"list::tests::next_index_increment",
"list::tests::test_into_iter",
"map::tests::next_index_increment",
"map::tests::test_into_iter",
"map::tests::test_map_get_at",
"map::tests::test_map_get_at_mut",
"path::parse::test::parse_invalid",
"path::tests::accept_leading_tokens",
"path::tests::parsed_path_parse",
"path::tests::reflect_array_behaves_like_list",
"path::tests::reflect_array_behaves_like_list_mut",
"path::tests::reflect_path",
"path::tests::parsed_path_get_field",
"struct_trait::tests::next_index_increment",
"tests::assert_impl_reflect_macro_on_all",
"tests::custom_debug_function",
"tests::docstrings::should_contain_docs",
"tests::docstrings::fields_should_contain_docs",
"serde::de::tests::should_deserialize_value",
"tests::as_reflect",
"tests::docstrings::should_not_contain_docs",
"serde::de::tests::should_deserialized_typed",
"serde::tests::should_not_serialize_unproxied_dynamic - should panic",
"tests::from_reflect_should_use_default_variant_field_attributes",
"tests::from_reflect_should_use_default_container_attribute",
"tests::docstrings::variants_should_contain_docs",
"serde::ser::tests::enum_should_serialize",
"serde::ser::tests::should_serialize_self_describing_binary",
"tests::from_reflect_should_allow_ignored_unnamed_fields",
"tests::from_reflect_should_use_default_field_attributes",
"serde::ser::tests::should_serialize_option",
"serde::de::tests::enum_should_deserialize",
"tests::can_opt_out_type_path",
"serde::ser::tests::should_serialize_non_self_describing_binary",
"serde::ser::tests::should_serialize_dynamic_option",
"tests::glam::vec3_field_access",
"serde::de::tests::should_deserialize_option",
"serde::de::tests::should_deserialize_non_self_describing_binary",
"tests::glam::vec3_path_access",
"tests::glam::vec3_apply_dynamic",
"tests::dynamic_types_debug_format",
"tests::multiple_reflect_lists",
"serde::ser::tests::should_serialize",
"serde::tests::should_roundtrip_proxied_dynamic",
"serde::tests::test_serialization_struct",
"tests::into_reflect",
"tests::multiple_reflect_value_lists",
"tests::glam::quat_serialization",
"serde::de::tests::should_deserialize",
"serde::tests::test_serialization_tuple_struct",
"tests::reflect_downcast",
"tests::recursive_registration_does_not_hang",
"tests::glam::quat_deserialization",
"tests::glam::vec3_deserialization",
"tests::not_dynamic_names",
"tests::recursive_typed_storage_does_not_hang",
"serde::de::tests::should_deserialize_self_describing_binary",
"tests::reflect_complex_patch",
"tests::reflect_ignore",
"tests::glam::vec3_serialization",
"tests::reflect_struct",
"tests::reflect_map",
"tests::reflect_take",
"tests::reflect_unit_struct",
"serde::de::tests::should_reserialize",
"tests::reflect_type_path",
"tests::reflect_type_info",
"tests::should_allow_custom_where_with_assoc_type",
"tests::should_allow_custom_where",
"tests::should_allow_empty_custom_where",
"tests::should_allow_dynamic_fields",
"tests::should_allow_multiple_custom_where",
"tests::should_drain_fields",
"tests::should_permit_higher_ranked_lifetimes",
"tests::should_not_auto_register_existing_types",
"tests::reflect_serialize",
"tests::should_call_from_reflect_dynamically",
"tests::should_permit_valid_represented_type_for_dynamic",
"tests::should_auto_register_fields",
"tests::should_prohibit_invalid_represented_type_for_dynamic - should panic",
"tests::try_apply_should_detect_kinds",
"tests::should_reflect_debug",
"tests::std_type_paths",
"tuple::tests::next_index_increment",
"tuple_struct::tests::next_index_increment",
"type_registry::test::test_reflect_from_ptr",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Unit (line 30)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Tuple (line 53)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Struct (line 43)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Struct (line 12)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Tuple (line 22)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Unit (line 61)",
"crates/bevy_reflect/src/utility.rs - utility::NonGenericTypeCell (line 50)",
"crates/bevy_reflect/src/type_info.rs - type_info::Typed (line 26)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 131)",
"crates/bevy_reflect/src/type_path.rs - type_path::TypePath (line 39)",
"crates/bevy_reflect/src/lib.rs - (line 296)",
"crates/bevy_reflect/src/lib.rs - (line 39)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 171)",
"crates/bevy_reflect/src/tuple.rs - tuple::Tuple (line 24)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::TupleStruct (line 23)",
"crates/bevy_reflect/src/tuple.rs - tuple::GetTupleField (line 95)",
"crates/bevy_reflect/src/lib.rs - (line 191)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 61)",
"crates/bevy_reflect/src/lib.rs - (line 142)",
"crates/bevy_reflect/src/tuple.rs - tuple::tuple_debug (line 461)",
"crates/bevy_reflect/src/attributes.rs - attributes::CustomAttributes (line 15)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::GetTupleStructField (line 189)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 327)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistration (line 451)",
"crates/bevy_reflect/src/lib.rs - (line 106)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 159)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 81)",
"crates/bevy_reflect/src/enums/dynamic_enum.rs - enums::dynamic_enum::DynamicEnum (line 54)",
"crates/bevy_reflect/src/lib.rs - (line 177)",
"crates/bevy_reflect/src/array.rs - array::Array (line 30)",
"crates/bevy_reflect/src/map.rs - map::Map (line 28)",
"crates/bevy_reflect/src/lib.rs - (line 216)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::Struct (line 27)",
"crates/bevy_reflect/src/lib.rs - (line 314)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register (line 127)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 122)",
"crates/bevy_reflect/src/enums/helpers.rs - enums::helpers::enum_debug (line 82)",
"crates/bevy_reflect/src/list.rs - list::List (line 37)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 145)",
"crates/bevy_reflect/src/lib.rs - (line 275)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::tuple_struct_debug (line 462)",
"crates/bevy_reflect/src/serde/type_data.rs - serde::type_data::SerializationData::generate_default (line 69)",
"crates/bevy_reflect/src/lib.rs - (line 156)",
"crates/bevy_reflect/src/lib.rs - (line 247)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::GetField (line 238)",
"crates/bevy_reflect/src/lib.rs - (line 85)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 315)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::is_ambiguous (line 348)",
"crates/bevy_reflect/src/list.rs - list::list_debug (line 510)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::struct_debug (line 546)",
"crates/bevy_reflect/src/serde/ser.rs - serde::ser::TypedReflectSerializer (line 145)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath::parse (line 373)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 181)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register_type_data (line 250)",
"crates/bevy_reflect/src/serde/type_data.rs - serde::type_data::SerializationData::is_field_skipped (line 29)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath (line 339)",
"crates/bevy_reflect/src/serde/ser.rs - serde::ser::ReflectSerializer (line 67)",
"crates/bevy_reflect/src/array.rs - array::array_debug (line 484)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 211)",
"crates/bevy_reflect/src/serde/de.rs - serde::de::ReflectDeserializer (line 320)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::ReflectFromPtr (line 651)",
"crates/bevy_reflect/src/lib.rs - (line 357)",
"crates/bevy_reflect/src/serde/de.rs - serde::de::TypedReflectDeserializer (line 453)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 13,650
|
bevyengine__bevy-13650
|
[
"10958"
] |
cca4fc76de29762d313d6bc567ae709445b24c27
|
diff --git a/crates/bevy_ecs/src/reflect/map_entities.rs b/crates/bevy_ecs/src/reflect/map_entities.rs
--- a/crates/bevy_ecs/src/reflect/map_entities.rs
+++ b/crates/bevy_ecs/src/reflect/map_entities.rs
@@ -73,3 +73,34 @@ impl<C: Component + MapEntities> FromType<C> for ReflectMapEntities {
}
}
}
+
+/// For a specific type of resource, this maps any fields with values of type [`Entity`] to a new world.
+/// Since a given `Entity` ID is only valid for the world it came from, when performing deserialization
+/// any stored IDs need to be re-allocated in the destination world.
+///
+/// See [`SceneEntityMapper`] and [`MapEntities`] for more information.
+#[derive(Clone)]
+pub struct ReflectMapEntitiesResource {
+ map_entities: fn(&mut World, &mut SceneEntityMapper),
+}
+
+impl ReflectMapEntitiesResource {
+ /// A method for applying [`MapEntities`] behavior to elements in an [`EntityHashMap<Entity>`].
+ pub fn map_entities(&self, world: &mut World, entity_map: &mut EntityHashMap<Entity>) {
+ SceneEntityMapper::world_scope(entity_map, world, |world, mapper| {
+ (self.map_entities)(world, mapper);
+ });
+ }
+}
+
+impl<R: crate::system::Resource + MapEntities> FromType<R> for ReflectMapEntitiesResource {
+ fn from_type() -> Self {
+ ReflectMapEntitiesResource {
+ map_entities: |world, entity_mapper| {
+ if let Some(mut resource) = world.get_resource_mut::<R>() {
+ resource.map_entities(entity_mapper);
+ }
+ },
+ }
+ }
+}
diff --git a/crates/bevy_ecs/src/reflect/mod.rs b/crates/bevy_ecs/src/reflect/mod.rs
--- a/crates/bevy_ecs/src/reflect/mod.rs
+++ b/crates/bevy_ecs/src/reflect/mod.rs
@@ -19,7 +19,7 @@ pub use bundle::{ReflectBundle, ReflectBundleFns};
pub use component::{ReflectComponent, ReflectComponentFns};
pub use entity_commands::ReflectCommandExt;
pub use from_world::{ReflectFromWorld, ReflectFromWorldFns};
-pub use map_entities::ReflectMapEntities;
+pub use map_entities::{ReflectMapEntities, ReflectMapEntitiesResource};
pub use resource::{ReflectResource, ReflectResourceFns};
/// A [`Resource`] storing [`TypeRegistry`] for
diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs
--- a/crates/bevy_scene/src/dynamic_scene.rs
+++ b/crates/bevy_scene/src/dynamic_scene.rs
@@ -11,7 +11,7 @@ use bevy_utils::TypeIdMap;
#[cfg(feature = "serialize")]
use crate::serde::SceneSerializer;
use bevy_asset::Asset;
-use bevy_ecs::reflect::ReflectResource;
+use bevy_ecs::reflect::{ReflectMapEntitiesResource, ReflectResource};
#[cfg(feature = "serialize")]
use serde::Serialize;
diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs
--- a/crates/bevy_scene/src/dynamic_scene.rs
+++ b/crates/bevy_scene/src/dynamic_scene.rs
@@ -71,28 +71,6 @@ impl DynamicScene {
) -> Result<(), SceneSpawnError> {
let type_registry = type_registry.read();
- for resource in &self.resources {
- let type_info = resource.get_represented_type_info().ok_or_else(|| {
- SceneSpawnError::NoRepresentedType {
- type_path: resource.reflect_type_path().to_string(),
- }
- })?;
- let registration = type_registry.get(type_info.type_id()).ok_or_else(|| {
- SceneSpawnError::UnregisteredButReflectedType {
- type_path: type_info.type_path().to_string(),
- }
- })?;
- let reflect_resource = registration.data::<ReflectResource>().ok_or_else(|| {
- SceneSpawnError::UnregisteredResource {
- type_path: type_info.type_path().to_string(),
- }
- })?;
-
- // If the world already contains an instance of the given resource
- // just apply the (possibly) new value, otherwise insert the resource
- reflect_resource.apply_or_insert(world, &**resource, &type_registry);
- }
-
// For each component types that reference other entities, we keep track
// of which entities in the scene use that component.
// This is so we can update the scene-internal references to references
diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs
--- a/crates/bevy_scene/src/dynamic_scene.rs
+++ b/crates/bevy_scene/src/dynamic_scene.rs
@@ -153,6 +131,35 @@ impl DynamicScene {
}
}
+ // Insert resources after all entities have been added to the world.
+ // This ensures the entities are available for the resources to reference during mapping.
+ for resource in &self.resources {
+ let type_info = resource.get_represented_type_info().ok_or_else(|| {
+ SceneSpawnError::NoRepresentedType {
+ type_path: resource.reflect_type_path().to_string(),
+ }
+ })?;
+ let registration = type_registry.get(type_info.type_id()).ok_or_else(|| {
+ SceneSpawnError::UnregisteredButReflectedType {
+ type_path: type_info.type_path().to_string(),
+ }
+ })?;
+ let reflect_resource = registration.data::<ReflectResource>().ok_or_else(|| {
+ SceneSpawnError::UnregisteredResource {
+ type_path: type_info.type_path().to_string(),
+ }
+ })?;
+
+ // If the world already contains an instance of the given resource
+ // just apply the (possibly) new value, otherwise insert the resource
+ reflect_resource.apply_or_insert(world, &**resource, &type_registry);
+
+ // Map entities in the resource if it implements [`MapEntities`].
+ if let Some(map_entities_reflect) = registration.data::<ReflectMapEntitiesResource>() {
+ map_entities_reflect.map_entities(world, entity_map);
+ }
+ }
+
Ok(())
}
|
diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs
--- a/crates/bevy_scene/src/dynamic_scene.rs
+++ b/crates/bevy_scene/src/dynamic_scene.rs
@@ -198,12 +205,68 @@ where
#[cfg(test)]
mod tests {
- use bevy_ecs::entity::EntityHashMap;
+ use bevy_ecs::entity::{Entity, EntityHashMap, EntityMapper, MapEntities};
+ use bevy_ecs::reflect::{ReflectMapEntitiesResource, ReflectResource};
+ use bevy_ecs::system::Resource;
use bevy_ecs::{reflect::AppTypeRegistry, world::Command, world::World};
use bevy_hierarchy::{Parent, PushChild};
+ use bevy_reflect::Reflect;
use crate::dynamic_scene_builder::DynamicSceneBuilder;
+ #[derive(Resource, Reflect, Debug)]
+ #[reflect(Resource, MapEntitiesResource)]
+ struct TestResource {
+ entity_a: Entity,
+ entity_b: Entity,
+ }
+
+ impl MapEntities for TestResource {
+ fn map_entities<M: EntityMapper>(&mut self, entity_mapper: &mut M) {
+ self.entity_a = entity_mapper.map_entity(self.entity_a);
+ self.entity_b = entity_mapper.map_entity(self.entity_b);
+ }
+ }
+
+ #[test]
+ fn resource_entity_map_maps_entities() {
+ let type_registry = AppTypeRegistry::default();
+ type_registry.write().register::<TestResource>();
+
+ let mut source_world = World::new();
+ source_world.insert_resource(type_registry.clone());
+
+ let original_entity_a = source_world.spawn_empty().id();
+ let original_entity_b = source_world.spawn_empty().id();
+
+ source_world.insert_resource(TestResource {
+ entity_a: original_entity_a,
+ entity_b: original_entity_b,
+ });
+
+ // Write the scene.
+ let scene = DynamicSceneBuilder::from_world(&source_world)
+ .extract_resources()
+ .extract_entity(original_entity_a)
+ .extract_entity(original_entity_b)
+ .build();
+
+ let mut entity_map = EntityHashMap::default();
+ let mut destination_world = World::new();
+ destination_world.insert_resource(type_registry);
+
+ scene
+ .write_to_world(&mut destination_world, &mut entity_map)
+ .unwrap();
+
+ let &from_entity_a = entity_map.get(&original_entity_a).unwrap();
+ let &from_entity_b = entity_map.get(&original_entity_b).unwrap();
+
+ let test_resource = destination_world.get_resource::<TestResource>().unwrap();
+ assert_eq!(from_entity_a, test_resource.entity_a);
+ assert_eq!(from_entity_b, test_resource.entity_b);
+ }
+
#[test]
fn components_not_defined_in_scene_should_not_be_affected_by_scene_entity_map() {
// Testing that scene reloading applies EntityMap correctly to MapEntities components.
|
`ReflectMapEntities` on Resources
## Bevy version
`0.12.1`
## What you did
```rust
#[derive(Resource, Reflect, Clone, Default)]
#[reflect(Resource, MapEntities)]
pub struct MyResource {
entity: Entity
}
impl MapEntities for MyResource {
fn map_entities(&mut self, entity_mapper: &mut EntityMapper) {
*self.entity = entity_mapper.get_or_reserve(self.entity);
}
}
```
## What went wrong
```
error[E0277]: the trait bound `app::MyResource: bevy::prelude::Component` is not satisfied
--> src/main.rs:20:20
|
500 | #[derive(Resource, Reflect, Clone, Default)]
| ^^^^^^^ the trait `bevy::prelude::Component` is not implemented for `app::MyResource`
|
= help: the following other types implement trait `bevy::prelude::Component`:
AccessibilityNode
bevy::prelude::Name
GlobalTransform
Transform
Children
SceneInstance
Parent
and 170 others
= note: required for `ReflectMapEntities` to implement `FromType<app::MyResource>`
= note: this error originates in the derive macro `Reflect` (in Nightly builds, run with -Z macro-backtrace for more info)
```
## Additional Information
Looks like this is caused by `ReflectMapEntities` having a Component bound on `FromType`.
|
I believe a workaround would be to derive `Component` in addition to `Resource`, this should still work with `bevy_scene`'s implementation of `MapEntities`.
I was just looking at this wrt. `DynamicScene`, which is missing the implementation to call `map_entities` for `Resource`s implementing the trait. Given the scene serializes with this information, and nothing prevents resources including entities, it'd be nice to add this.
For now, I'm considering:
1. Extending `DynamicScene` with an extra method I can use to perform this extra step.
2. Converting my resource to a sparse-set component 🙈
For context, I'm trying to use `bevy_save` or `moonshine_save`, which leverage `DynamicScene` but also don't cover this gap. So I'll probably choose option 2 😅
This seems like a footgun. At the moment you can extract resources with entities and even force the compiler to accept reflect(MapEntities) on a resource by making it also a component, but there is no map_entities call for resources when inserted into a world.
|
2024-06-03T15:18:37Z
|
1.77
|
2024-06-03T20:51:57Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"dynamic_scene_builder::tests::extract_entity_order",
"dynamic_scene_builder::tests::extract_one_resource",
"dynamic_scene_builder::tests::extract_one_entity",
"dynamic_scene_builder::tests::extract_one_entity_two_components",
"dynamic_scene_builder::tests::extract_one_entity_twice",
"dynamic_scene_builder::tests::extract_one_resource_twice",
"scene_filter::tests::should_remove_from_list",
"scene_filter::tests::should_add_to_list",
"dynamic_scene_builder::tests::should_extract_allowed_resources",
"dynamic_scene::tests::components_not_defined_in_scene_should_not_be_affected_by_scene_entity_map",
"scene_filter::tests::should_set_list_type_if_none",
"dynamic_scene_builder::tests::remove_componentless_entity",
"dynamic_scene_builder::tests::should_not_extract_denied_resources",
"dynamic_scene_builder::tests::extract_query",
"dynamic_scene_builder::tests::should_not_extract_denied_components",
"dynamic_scene_builder::tests::should_extract_allowed_components",
"scene_spawner::tests::clone_dynamic_entities",
"serde::tests::assert_scene_eq_tests::should_panic_when_entity_count_not_eq - should panic",
"serde::tests::should_roundtrip_bincode",
"serde::tests::assert_scene_eq_tests::should_panic_when_missing_component - should panic",
"serde::tests::assert_scene_eq_tests::should_panic_when_components_not_eq - should panic",
"serde::tests::should_roundtrip_postcard",
"serde::tests::should_roundtrip_messagepack",
"serde::tests::should_serialize",
"serde::tests::should_deserialize",
"serde::tests::should_roundtrip_with_later_generations_and_obsolete_references",
"scene_spawner::tests::event",
"scene_spawner::tests::despawn_scene",
"bundle::tests::spawn_and_delete",
"crates/bevy_scene/src/dynamic_scene_builder.rs - dynamic_scene_builder::DynamicSceneBuilder<'w>::extract_resources (line 297)",
"crates/bevy_scene/src/dynamic_scene_builder.rs - dynamic_scene_builder::DynamicSceneBuilder (line 40)",
"crates/bevy_scene/src/dynamic_scene_builder.rs - dynamic_scene_builder::DynamicSceneBuilder<'w>::extract_entities (line 220)",
"crates/bevy_scene/src/serde.rs - serde::SceneSerializer (line 38)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 13,451
|
bevyengine__bevy-13451
|
[
"13407"
] |
5a1c62faae54bae1291c6f80898f29153faa0979
|
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -143,6 +143,35 @@ impl Dir2 {
pub const fn as_vec2(&self) -> Vec2 {
self.0
}
+
+ /// Performs a spherical linear interpolation between `self` and `rhs`
+ /// based on the value `s`.
+ ///
+ /// This corresponds to interpolating between the two directions at a constant angular velocity.
+ ///
+ /// When `s == 0.0`, the result will be equal to `self`.
+ /// When `s == 1.0`, the result will be equal to `rhs`.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # use bevy_math::Dir2;
+ /// # use approx::{assert_relative_eq, RelativeEq};
+ /// #
+ /// let dir1 = Dir2::X;
+ /// let dir2 = Dir2::Y;
+ ///
+ /// let result1 = dir1.slerp(dir2, 1.0 / 3.0);
+ /// assert_relative_eq!(result1, Dir2::from_xy(0.75_f32.sqrt(), 0.5).unwrap());
+ ///
+ /// let result2 = dir1.slerp(dir2, 0.5);
+ /// assert_relative_eq!(result2, Dir2::from_xy(0.5_f32.sqrt(), 0.5_f32.sqrt()).unwrap());
+ /// ```
+ #[inline]
+ pub fn slerp(self, rhs: Self, s: f32) -> Self {
+ let angle = self.angle_between(rhs.0);
+ Rotation2d::radians(angle * s) * self
+ }
}
impl TryFrom<Vec2> for Dir2 {
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -307,6 +336,39 @@ impl Dir3 {
pub const fn as_vec3(&self) -> Vec3 {
self.0
}
+
+ /// Performs a spherical linear interpolation between `self` and `rhs`
+ /// based on the value `s`.
+ ///
+ /// This corresponds to interpolating between the two directions at a constant angular velocity.
+ ///
+ /// When `s == 0.0`, the result will be equal to `self`.
+ /// When `s == 1.0`, the result will be equal to `rhs`.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # use bevy_math::Dir3;
+ /// # use approx::{assert_relative_eq, RelativeEq};
+ /// #
+ /// let dir1 = Dir3::X;
+ /// let dir2 = Dir3::Y;
+ ///
+ /// let result1 = dir1.slerp(dir2, 1.0 / 3.0);
+ /// assert_relative_eq!(
+ /// result1,
+ /// Dir3::from_xyz(0.75_f32.sqrt(), 0.5, 0.0).unwrap(),
+ /// epsilon = 0.000001
+ /// );
+ ///
+ /// let result2 = dir1.slerp(dir2, 0.5);
+ /// assert_relative_eq!(result2, Dir3::from_xyz(0.5_f32.sqrt(), 0.5_f32.sqrt(), 0.0).unwrap());
+ /// ```
+ #[inline]
+ pub fn slerp(self, rhs: Self, s: f32) -> Self {
+ let quat = Quat::IDENTITY.slerp(Quat::from_rotation_arc(self.0, rhs.0), s);
+ Dir3(quat.mul_vec3(self.0))
+ }
}
impl TryFrom<Vec3> for Dir3 {
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -474,6 +536,42 @@ impl Dir3A {
pub const fn as_vec3a(&self) -> Vec3A {
self.0
}
+
+ /// Performs a spherical linear interpolation between `self` and `rhs`
+ /// based on the value `s`.
+ ///
+ /// This corresponds to interpolating between the two directions at a constant angular velocity.
+ ///
+ /// When `s == 0.0`, the result will be equal to `self`.
+ /// When `s == 1.0`, the result will be equal to `rhs`.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # use bevy_math::Dir3A;
+ /// # use approx::{assert_relative_eq, RelativeEq};
+ /// #
+ /// let dir1 = Dir3A::X;
+ /// let dir2 = Dir3A::Y;
+ ///
+ /// let result1 = dir1.slerp(dir2, 1.0 / 3.0);
+ /// assert_relative_eq!(
+ /// result1,
+ /// Dir3A::from_xyz(0.75_f32.sqrt(), 0.5, 0.0).unwrap(),
+ /// epsilon = 0.000001
+ /// );
+ ///
+ /// let result2 = dir1.slerp(dir2, 0.5);
+ /// assert_relative_eq!(result2, Dir3A::from_xyz(0.5_f32.sqrt(), 0.5_f32.sqrt(), 0.0).unwrap());
+ /// ```
+ #[inline]
+ pub fn slerp(self, rhs: Self, s: f32) -> Self {
+ let quat = Quat::IDENTITY.slerp(
+ Quat::from_rotation_arc(Vec3::from(self.0), Vec3::from(rhs.0)),
+ s,
+ );
+ Dir3A(quat.mul_vec3a(self.0))
+ }
}
impl From<Dir3> for Dir3A {
|
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -582,6 +680,7 @@ impl approx::UlpsEq for Dir3A {
#[cfg(test)]
mod tests {
use super::*;
+ use approx::assert_relative_eq;
#[test]
fn dir2_creation() {
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -605,6 +704,24 @@ mod tests {
assert_eq!(Dir2::new_and_length(Vec2::X * 6.5), Ok((Dir2::X, 6.5)));
}
+ #[test]
+ fn dir2_slerp() {
+ assert_relative_eq!(
+ Dir2::X.slerp(Dir2::Y, 0.5),
+ Dir2::from_xy(0.5_f32.sqrt(), 0.5_f32.sqrt()).unwrap()
+ );
+ assert_eq!(Dir2::Y.slerp(Dir2::X, 0.0), Dir2::Y);
+ assert_relative_eq!(Dir2::X.slerp(Dir2::Y, 1.0), Dir2::Y);
+ assert_relative_eq!(
+ Dir2::Y.slerp(Dir2::X, 1.0 / 3.0),
+ Dir2::from_xy(0.5, 0.75_f32.sqrt()).unwrap()
+ );
+ assert_relative_eq!(
+ Dir2::X.slerp(Dir2::Y, 2.0 / 3.0),
+ Dir2::from_xy(0.5, 0.75_f32.sqrt()).unwrap()
+ );
+ }
+
#[test]
fn dir3_creation() {
assert_eq!(Dir3::new(Vec3::X * 12.5), Ok(Dir3::X));
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -633,6 +750,25 @@ mod tests {
);
}
+ #[test]
+ fn dir3_slerp() {
+ assert_relative_eq!(
+ Dir3::X.slerp(Dir3::Y, 0.5),
+ Dir3::from_xyz(0.5f32.sqrt(), 0.5f32.sqrt(), 0.0).unwrap()
+ );
+ assert_relative_eq!(Dir3::Y.slerp(Dir3::Z, 0.0), Dir3::Y);
+ assert_relative_eq!(Dir3::Z.slerp(Dir3::X, 1.0), Dir3::X, epsilon = 0.000001);
+ assert_relative_eq!(
+ Dir3::X.slerp(Dir3::Z, 1.0 / 3.0),
+ Dir3::from_xyz(0.75f32.sqrt(), 0.0, 0.5).unwrap(),
+ epsilon = 0.000001
+ );
+ assert_relative_eq!(
+ Dir3::Z.slerp(Dir3::Y, 2.0 / 3.0),
+ Dir3::from_xyz(0.0, 0.75f32.sqrt(), 0.5).unwrap()
+ );
+ }
+
#[test]
fn dir3a_creation() {
assert_eq!(Dir3A::new(Vec3A::X * 12.5), Ok(Dir3A::X));
diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs
--- a/crates/bevy_math/src/direction.rs
+++ b/crates/bevy_math/src/direction.rs
@@ -660,4 +796,23 @@ mod tests {
.abs_diff_eq(Vec3A::Y, 10e-6)
);
}
+
+ #[test]
+ fn dir3a_slerp() {
+ assert_relative_eq!(
+ Dir3A::X.slerp(Dir3A::Y, 0.5),
+ Dir3A::from_xyz(0.5f32.sqrt(), 0.5f32.sqrt(), 0.0).unwrap()
+ );
+ assert_relative_eq!(Dir3A::Y.slerp(Dir3A::Z, 0.0), Dir3A::Y);
+ assert_relative_eq!(Dir3A::Z.slerp(Dir3A::X, 1.0), Dir3A::X, epsilon = 0.000001);
+ assert_relative_eq!(
+ Dir3A::X.slerp(Dir3A::Z, 1.0 / 3.0),
+ Dir3A::from_xyz(0.75f32.sqrt(), 0.0, 0.5).unwrap(),
+ epsilon = 0.000001
+ );
+ assert_relative_eq!(
+ Dir3A::Z.slerp(Dir3A::Y, 2.0 / 3.0),
+ Dir3A::from_xyz(0.0, 0.75f32.sqrt(), 0.5).unwrap()
+ );
+ }
}
|
slerp functions for directions (Vec2 and Vec3)
## What problem does this solve or what need does it fill?
Linear interpolation is unsuited for transitioning of directions.
## What solution would you like?
I would like a spherical interpolation function (slerp) for Vec2 and Vec3 directions.
## Additional context
This is a common feature in existing game engines:
https://docs.godotengine.org/en/stable/classes/class_vector3.html#class-vector3-method-slerp
https://docs.unity3d.com/ScriptReference/Vector3.Slerp.html
|
[Vec2 and Vec3 is part of glam crate](https://github.com/bevyengine/bevy/blob/11f0a2dcdeb86651fdb6cdaf2c83ffd01df93149/crates/bevy_math/src/common_traits.rs#L1), this problem should be solved there, futhermore there is already [long living issue](https://github.com/bitshifter/glam-rs/issues/377)
@bugsweeper You're right that the vector types are owned by glam, but on the other hand, we could easily implement `slerp` functions for the `Dir2`/`Dir3` types that we *do* own, and I think those would be quite useful.
|
2024-05-21T10:39:48Z
|
1.77
|
2024-05-21T21:28:31Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"bounding::bounded2d::aabb2d_tests::center",
"bounding::bounded2d::aabb2d_tests::area",
"bounding::bounded2d::aabb2d_tests::contains",
"bounding::bounded2d::aabb2d_tests::closest_point",
"bounding::bounded2d::aabb2d_tests::grow",
"bounding::bounded2d::aabb2d_tests::half_size",
"bounding::bounded2d::aabb2d_tests::intersect_aabb",
"bounding::bounded2d::aabb2d_tests::intersect_bounding_circle",
"bounding::bounded2d::aabb2d_tests::merge",
"bounding::bounded2d::aabb2d_tests::shrink",
"bounding::bounded2d::aabb2d_tests::scale_around_center",
"bounding::bounded2d::aabb2d_tests::transform",
"bounding::bounded2d::bounding_circle_tests::area",
"bounding::bounded2d::bounding_circle_tests::closest_point",
"bounding::bounded2d::bounding_circle_tests::contains",
"bounding::bounded2d::bounding_circle_tests::contains_identical",
"bounding::bounded2d::bounding_circle_tests::grow",
"bounding::bounded2d::bounding_circle_tests::intersect_bounding_circle",
"bounding::bounded2d::bounding_circle_tests::merge",
"bounding::bounded2d::bounding_circle_tests::merge_identical",
"bounding::bounded2d::bounding_circle_tests::scale_around_center",
"bounding::bounded2d::bounding_circle_tests::shrink",
"bounding::bounded2d::bounding_circle_tests::transform",
"bounding::bounded2d::primitive_impls::tests::acute_triangle",
"bounding::bounded2d::primitive_impls::tests::capsule",
"bounding::bounded2d::primitive_impls::tests::circle",
"bounding::bounded2d::primitive_impls::tests::ellipse",
"bounding::bounded2d::primitive_impls::tests::line",
"bounding::bounded2d::primitive_impls::tests::obtuse_triangle",
"bounding::bounded2d::primitive_impls::tests::plane",
"bounding::bounded2d::primitive_impls::tests::polygon",
"bounding::bounded2d::primitive_impls::tests::polyline",
"bounding::bounded2d::primitive_impls::tests::rectangle",
"bounding::bounded2d::primitive_impls::tests::regular_polygon",
"bounding::bounded2d::primitive_impls::tests::segment",
"bounding::bounded3d::aabb3d_tests::area",
"bounding::bounded3d::aabb3d_tests::center",
"bounding::bounded3d::aabb3d_tests::closest_point",
"bounding::bounded3d::aabb3d_tests::contains",
"bounding::bounded3d::aabb3d_tests::grow",
"bounding::bounded3d::aabb3d_tests::half_size",
"bounding::bounded3d::aabb3d_tests::intersect_aabb",
"bounding::bounded3d::aabb3d_tests::intersect_bounding_sphere",
"bounding::bounded3d::aabb3d_tests::merge",
"bounding::bounded3d::aabb3d_tests::scale_around_center",
"bounding::bounded3d::aabb3d_tests::shrink",
"bounding::bounded3d::aabb3d_tests::transform",
"bounding::bounded3d::bounding_sphere_tests::area",
"bounding::bounded3d::bounding_sphere_tests::closest_point",
"bounding::bounded3d::bounding_sphere_tests::contains",
"bounding::bounded3d::bounding_sphere_tests::contains_identical",
"bounding::bounded3d::bounding_sphere_tests::grow",
"bounding::bounded3d::bounding_sphere_tests::intersect_bounding_sphere",
"bounding::bounded3d::bounding_sphere_tests::merge",
"bounding::bounded3d::bounding_sphere_tests::merge_identical",
"bounding::bounded3d::bounding_sphere_tests::scale_around_center",
"bounding::bounded3d::bounding_sphere_tests::shrink",
"bounding::bounded3d::bounding_sphere_tests::transform",
"bounding::bounded3d::primitive_impls::tests::capsule",
"bounding::bounded3d::primitive_impls::tests::cone",
"bounding::bounded3d::primitive_impls::tests::conical_frustum",
"bounding::bounded3d::primitive_impls::tests::cuboid",
"bounding::bounded3d::primitive_impls::tests::cylinder",
"bounding::bounded3d::primitive_impls::tests::line",
"bounding::bounded3d::primitive_impls::tests::plane",
"bounding::bounded3d::primitive_impls::tests::polyline",
"bounding::bounded3d::primitive_impls::tests::segment",
"bounding::bounded3d::primitive_impls::tests::sphere",
"bounding::bounded3d::primitive_impls::tests::torus",
"bounding::bounded3d::primitive_impls::tests::wide_conical_frustum",
"bounding::raycast2d::tests::test_aabb_cast_hits",
"bounding::raycast2d::tests::test_circle_cast_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_inside",
"bounding::raycast2d::tests::test_ray_intersection_circle_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_misses",
"bounding::raycast2d::tests::test_ray_intersection_circle_inside",
"bounding::raycast2d::tests::test_ray_intersection_circle_misses",
"bounding::raycast3d::tests::test_aabb_cast_hits",
"bounding::raycast3d::tests::test_ray_intersection_aabb_hits",
"bounding::raycast3d::tests::test_ray_intersection_aabb_misses",
"bounding::raycast3d::tests::test_ray_intersection_aabb_inside",
"bounding::raycast3d::tests::test_ray_intersection_sphere_hits",
"bounding::raycast3d::tests::test_ray_intersection_sphere_misses",
"bounding::raycast3d::tests::test_ray_intersection_sphere_inside",
"cubic_splines::tests::cardinal_control_pts",
"bounding::raycast3d::tests::test_sphere_cast_hits",
"cubic_splines::tests::easing_overshoot",
"cubic_splines::tests::cubic_to_rational",
"cubic_splines::tests::easing_simple",
"cubic_splines::tests::nurbs_circular_arc",
"direction::tests::dir2_creation",
"cubic_splines::tests::cubic",
"direction::tests::dir3_creation",
"direction::tests::dir3a_creation",
"cubic_splines::tests::easing_undershoot",
"float_ord::tests::float_ord_cmp",
"float_ord::tests::float_ord_cmp_operators",
"float_ord::tests::float_ord_eq",
"float_ord::tests::float_ord_hash",
"primitives::dim2::tests::annulus_closest_point",
"primitives::dim2::tests::annulus_math",
"primitives::dim2::tests::circle_closest_point",
"primitives::dim2::tests::circle_math",
"primitives::dim2::tests::ellipse_math",
"primitives::dim2::tests::ellipse_perimeter",
"primitives::dim2::tests::rectangle_closest_point",
"primitives::dim2::tests::rectangle_math",
"primitives::dim2::tests::regular_polygon_math",
"primitives::dim2::tests::regular_polygon_vertices",
"primitives::dim2::tests::triangle_circumcenter",
"primitives::dim2::tests::triangle_math",
"primitives::dim2::tests::triangle_winding_order",
"primitives::dim3::tests::capsule_math",
"primitives::dim3::tests::cone_math",
"primitives::dim3::tests::cuboid_closest_point",
"primitives::dim3::tests::cuboid_math",
"primitives::dim3::tests::cylinder_math",
"primitives::dim3::tests::extrusion_math",
"primitives::dim3::tests::direction_creation",
"primitives::dim3::tests::infinite_plane_from_points",
"primitives::dim3::tests::plane_from_points",
"primitives::dim3::tests::sphere_closest_point",
"primitives::dim3::tests::sphere_math",
"primitives::dim3::tests::tetrahedron_math",
"primitives::dim3::tests::torus_math",
"primitives::dim3::tests::triangle_math",
"ray::tests::intersect_plane_2d",
"ray::tests::intersect_plane_3d",
"rects::irect::tests::rect_inset",
"rects::irect::tests::rect_intersect",
"rects::irect::tests::rect_union",
"rects::irect::tests::rect_union_pt",
"rects::irect::tests::well_formed",
"rects::rect::tests::rect_inset",
"rects::rect::tests::rect_intersect",
"rects::rect::tests::rect_union",
"rects::rect::tests::rect_union_pt",
"rects::rect::tests::well_formed",
"rects::urect::tests::rect_inset",
"rects::urect::tests::rect_intersect",
"rects::urect::tests::rect_union",
"rects::urect::tests::rect_union_pt",
"rects::urect::tests::well_formed",
"rotation2d::tests::add",
"rotation2d::tests::creation",
"rotation2d::tests::is_near_identity",
"rotation2d::tests::length",
"rotation2d::tests::nlerp",
"rotation2d::tests::normalize",
"rotation2d::tests::rotate",
"rotation2d::tests::slerp",
"rotation2d::tests::subtract",
"rotation2d::tests::try_normalize",
"sampling::shape_sampling::tests::circle_boundary_sampling",
"sampling::shape_sampling::tests::circle_interior_sampling",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::union_point (line 237)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::height (line 140)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::contains (line 208)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::is_empty (line 116)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::intersect (line 260)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_corners (line 46)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::union (line 226)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::new (line 29)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::half_size (line 168)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::center (line 194)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::width (line 130)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::is_empty (line 112)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::half_size (line 176)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_corners (line 46)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_center_half_size (line 90)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::new (line 29)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::size (line 154)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::union (line 223)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rotation2d (line 11)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicCardinalSpline (line 173)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::is_empty (line 113)",
"crates/bevy_math/src/sampling/standard.rs - sampling::standard::FromRng (line 37)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicBSpline (line 263)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicBezier (line 32)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::size (line 158)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::contains (line 205)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_center_size (line 73)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_center_size (line 69)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::height (line 144)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::width (line 126)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_corners (line 46)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_center_size (line 73)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::size (line 155)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::normalize (line 317)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::half_size (line 173)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::intersect (line 272)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicHermite (line 99)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::inset (line 288)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_center_half_size (line 94)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::center (line 191)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::intersect (line 269)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_center_half_size (line 94)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::inset (line 300)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicSegment<Vec2>::ease (line 717)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::new (line 29)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::contains (line 196)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::union_point (line 249)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rotation2d::nlerp (line 290)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::height (line 141)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::union (line 214)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicNurbs (line 378)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rotation2d::slerp (line 328)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling::ShapeSample::sample_interior (line 19)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::inset (line 297)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::width (line 127)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::center (line 182)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling::ShapeSample::sample_boundary (line 33)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::union_point (line 246)",
"crates/bevy_math/src/sampling/standard.rs - sampling::standard (line 7)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 12,997
|
bevyengine__bevy-12997
|
[
"12966"
] |
ade70b3925b27f76b669ac5fd9e2c31f824d7667
|
diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -67,7 +67,7 @@ default = [
"bevy_sprite",
"bevy_text",
"bevy_ui",
- "multi-threaded",
+ "multi_threaded",
"png",
"hdr",
"vorbis",
diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -252,7 +252,7 @@ symphonia-wav = ["bevy_internal/symphonia-wav"]
serialize = ["bevy_internal/serialize"]
# Enables multithreaded parallelism in the engine. Disabling it forces all engine tasks to run on a single thread.
-multi-threaded = ["bevy_internal/multi-threaded"]
+multi_threaded = ["bevy_internal/multi_threaded"]
# Use async-io's implementation of block_on instead of futures-lite's implementation. This is preferred if your application uses async-io.
async-io = ["bevy_internal/async-io"]
diff --git a/benches/Cargo.toml b/benches/Cargo.toml
--- a/benches/Cargo.toml
+++ b/benches/Cargo.toml
@@ -12,7 +12,7 @@ rand = "0.8"
rand_chacha = "0.3"
criterion = { version = "0.3", features = ["html_reports"] }
bevy_app = { path = "../crates/bevy_app" }
-bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi-threaded"] }
+bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi_threaded"] }
bevy_reflect = { path = "../crates/bevy_reflect" }
bevy_tasks = { path = "../crates/bevy_tasks" }
bevy_utils = { path = "../crates/bevy_utils" }
diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml
--- a/crates/bevy_asset/Cargo.toml
+++ b/crates/bevy_asset/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["bevy"]
[features]
file_watcher = ["notify-debouncer-full", "watch"]
embedded_watcher = ["file_watcher"]
-multi-threaded = ["bevy_tasks/multi-threaded"]
+multi_threaded = ["bevy_tasks/multi_threaded"]
asset_processor = []
watch = []
trace = []
diff --git a/crates/bevy_asset/src/io/file/mod.rs b/crates/bevy_asset/src/io/file/mod.rs
--- a/crates/bevy_asset/src/io/file/mod.rs
+++ b/crates/bevy_asset/src/io/file/mod.rs
@@ -1,9 +1,9 @@
#[cfg(feature = "file_watcher")]
mod file_watcher;
-#[cfg(feature = "multi-threaded")]
+#[cfg(feature = "multi_threaded")]
mod file_asset;
-#[cfg(not(feature = "multi-threaded"))]
+#[cfg(not(feature = "multi_threaded"))]
mod sync_file_asset;
use bevy_utils::tracing::error;
diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs
--- a/crates/bevy_asset/src/lib.rs
+++ b/crates/bevy_asset/src/lib.rs
@@ -62,11 +62,11 @@ use bevy_reflect::{FromReflect, GetTypeRegistration, Reflect, TypePath};
use bevy_utils::{tracing::error, HashSet};
use std::{any::TypeId, sync::Arc};
-#[cfg(all(feature = "file_watcher", not(feature = "multi-threaded")))]
+#[cfg(all(feature = "file_watcher", not(feature = "multi_threaded")))]
compile_error!(
"The \"file_watcher\" feature for hot reloading requires the \
- \"multi-threaded\" feature to be functional.\n\
- Consider either disabling the \"file_watcher\" feature or enabling \"multi-threaded\""
+ \"multi_threaded\" feature to be functional.\n\
+ Consider either disabling the \"file_watcher\" feature or enabling \"multi_threaded\""
);
/// Provides "asset" loading and processing functionality. An [`Asset`] is a "runtime value" that is loaded from an [`AssetSource`],
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -152,9 +152,9 @@ impl AssetProcessor {
/// Starts the processor in a background thread.
pub fn start(_processor: Res<Self>) {
- #[cfg(any(target_arch = "wasm32", not(feature = "multi-threaded")))]
+ #[cfg(any(target_arch = "wasm32", not(feature = "multi_threaded")))]
error!("Cannot run AssetProcessor in single threaded mode (or WASM) yet.");
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
{
let processor = _processor.clone();
std::thread::spawn(move || {
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -322,9 +322,9 @@ impl AssetProcessor {
"Folder {} was added. Attempting to re-process",
AssetPath::from_path(&path).with_source(source.id())
);
- #[cfg(any(target_arch = "wasm32", not(feature = "multi-threaded")))]
+ #[cfg(any(target_arch = "wasm32", not(feature = "multi_threaded")))]
error!("AddFolder event cannot be handled in single threaded mode (or WASM) yet.");
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
IoTaskPool::get().scope(|scope| {
scope.spawn(async move {
self.process_assets_internal(scope, source, path)
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -439,7 +439,7 @@ impl AssetProcessor {
}
#[allow(unused)]
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
async fn process_assets_internal<'scope>(
&'scope self,
scope: &'scope bevy_tasks::Scope<'scope, '_, ()>,
diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml
--- a/crates/bevy_ecs/Cargo.toml
+++ b/crates/bevy_ecs/Cargo.toml
@@ -11,7 +11,7 @@ categories = ["game-engines", "data-structures"]
[features]
trace = []
-multi-threaded = ["bevy_tasks/multi-threaded", "arrayvec"]
+multi_threaded = ["bevy_tasks/multi_threaded", "arrayvec"]
bevy_debug_stepping = []
default = ["bevy_reflect"]
diff --git a/crates/bevy_ecs/src/event.rs b/crates/bevy_ecs/src/event.rs
--- a/crates/bevy_ecs/src/event.rs
+++ b/crates/bevy_ecs/src/event.rs
@@ -921,12 +921,12 @@ impl<'a, E: Event> EventParIter<'a, E> {
///
/// [`ComputeTaskPool`]: bevy_tasks::ComputeTaskPool
pub fn for_each_with_id<FN: Fn(&'a E, EventId<E>) + Send + Sync + Clone>(self, func: FN) {
- #[cfg(any(target_arch = "wasm32", not(feature = "multi-threaded")))]
+ #[cfg(any(target_arch = "wasm32", not(feature = "multi_threaded")))]
{
self.into_iter().for_each(|(e, i)| func(e, i));
}
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
{
let pool = bevy_tasks::ComputeTaskPool::get();
let thread_count = pool.thread_num();
diff --git a/crates/bevy_ecs/src/query/par_iter.rs b/crates/bevy_ecs/src/query/par_iter.rs
--- a/crates/bevy_ecs/src/query/par_iter.rs
+++ b/crates/bevy_ecs/src/query/par_iter.rs
@@ -78,7 +78,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryParIter<'w, 's, D, F> {
func(&mut init, item);
init
};
- #[cfg(any(target_arch = "wasm32", not(feature = "multi-threaded")))]
+ #[cfg(any(target_arch = "wasm32", not(feature = "multi_threaded")))]
{
let init = init();
// SAFETY:
diff --git a/crates/bevy_ecs/src/query/par_iter.rs b/crates/bevy_ecs/src/query/par_iter.rs
--- a/crates/bevy_ecs/src/query/par_iter.rs
+++ b/crates/bevy_ecs/src/query/par_iter.rs
@@ -93,7 +93,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryParIter<'w, 's, D, F> {
.fold(init, func);
}
}
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
{
let thread_count = bevy_tasks::ComputeTaskPool::get().thread_num();
if thread_count <= 1 {
diff --git a/crates/bevy_ecs/src/query/par_iter.rs b/crates/bevy_ecs/src/query/par_iter.rs
--- a/crates/bevy_ecs/src/query/par_iter.rs
+++ b/crates/bevy_ecs/src/query/par_iter.rs
@@ -122,7 +122,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryParIter<'w, 's, D, F> {
}
}
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
fn get_batch_size(&self, thread_count: usize) -> usize {
let max_items = || {
let id_iter = self.state.matched_storage_ids.iter();
diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs
--- a/crates/bevy_ecs/src/query/state.rs
+++ b/crates/bevy_ecs/src/query/state.rs
@@ -1393,7 +1393,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
/// with a mismatched [`WorldId`] is unsound.
///
/// [`ComputeTaskPool`]: bevy_tasks::ComputeTaskPool
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
pub(crate) unsafe fn par_fold_init_unchecked_manual<'w, T, FN, INIT>(
&self,
init_accum: INIT,
diff --git a/crates/bevy_ecs/src/schedule/executor/mod.rs b/crates/bevy_ecs/src/schedule/executor/mod.rs
--- a/crates/bevy_ecs/src/schedule/executor/mod.rs
+++ b/crates/bevy_ecs/src/schedule/executor/mod.rs
@@ -38,18 +38,18 @@ pub enum ExecutorKind {
///
/// Useful if you're dealing with a single-threaded environment, saving your threads for
/// other things, or just trying minimize overhead.
- #[cfg_attr(any(target_arch = "wasm32", not(feature = "multi-threaded")), default)]
+ #[cfg_attr(any(target_arch = "wasm32", not(feature = "multi_threaded")), default)]
SingleThreaded,
/// Like [`SingleThreaded`](ExecutorKind::SingleThreaded) but calls [`apply_deferred`](crate::system::System::apply_deferred)
/// immediately after running each system.
Simple,
/// Runs the schedule using a thread pool. Non-conflicting systems can run in parallel.
- #[cfg_attr(all(not(target_arch = "wasm32"), feature = "multi-threaded"), default)]
+ #[cfg_attr(all(not(target_arch = "wasm32"), feature = "multi_threaded"), default)]
MultiThreaded,
}
/// Holds systems and conditions of a [`Schedule`](super::Schedule) sorted in topological order
-/// (along with dependency information for multi-threaded execution).
+/// (along with dependency information for `multi_threaded` execution).
///
/// Since the arrays are sorted in the same order, elements are referenced by their index.
/// [`FixedBitSet`] is used as a smaller, more efficient substitute of `HashSet<usize>`.
diff --git a/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
--- a/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
+++ b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
@@ -317,7 +317,7 @@ impl<'scope, 'env: 'scope, 'sys> Context<'scope, 'env, 'sys> {
}
impl MultiThreadedExecutor {
- /// Creates a new multi-threaded executor for use with a [`Schedule`].
+ /// Creates a new `multi_threaded` executor for use with a [`Schedule`].
///
/// [`Schedule`]: crate::schedule::Schedule
pub fn new() -> Self {
diff --git a/crates/bevy_ecs/src/schedule/schedule.rs b/crates/bevy_ecs/src/schedule/schedule.rs
--- a/crates/bevy_ecs/src/schedule/schedule.rs
+++ b/crates/bevy_ecs/src/schedule/schedule.rs
@@ -1337,7 +1337,7 @@ impl ScheduleGraph {
let hg_node_count = self.hierarchy.graph.node_count();
// get the number of dependencies and the immediate dependents of each system
- // (needed by multi-threaded executor to run systems in the correct order)
+ // (needed by multi_threaded executor to run systems in the correct order)
let mut system_dependencies = Vec::with_capacity(sys_count);
let mut system_dependents = Vec::with_capacity(sys_count);
for &sys_id in &dg_system_ids {
diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml
--- a/crates/bevy_internal/Cargo.toml
+++ b/crates/bevy_internal/Cargo.toml
@@ -77,11 +77,11 @@ serialize = [
"bevy_ui?/serialize",
"bevy_color?/serialize",
]
-multi-threaded = [
- "bevy_asset?/multi-threaded",
- "bevy_ecs/multi-threaded",
- "bevy_render?/multi-threaded",
- "bevy_tasks/multi-threaded",
+multi_threaded = [
+ "bevy_asset?/multi_threaded",
+ "bevy_ecs/multi_threaded",
+ "bevy_render?/multi_threaded",
+ "bevy_tasks/multi_threaded",
]
async-io = ["bevy_tasks/async-io"]
diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs
--- a/crates/bevy_internal/src/default_plugins.rs
+++ b/crates/bevy_internal/src/default_plugins.rs
@@ -79,7 +79,7 @@ impl PluginGroup for DefaultPlugins {
// compressed texture formats
.add(bevy_render::texture::ImagePlugin::default());
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
{
group = group.add(bevy_render::pipelined_rendering::PipelinedRenderingPlugin);
}
diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml
--- a/crates/bevy_render/Cargo.toml
+++ b/crates/bevy_render/Cargo.toml
@@ -18,7 +18,7 @@ bmp = ["image/bmp"]
webp = ["image/webp"]
dds = ["ddsfile"]
pnm = ["image/pnm"]
-multi-threaded = ["bevy_tasks/multi-threaded"]
+multi_threaded = ["bevy_tasks/multi_threaded"]
shader_format_glsl = ["naga/glsl-in", "naga/wgsl-out", "naga_oil/glsl"]
shader_format_spirv = ["wgpu/spirv", "naga/spv-in", "naga/spv-out"]
diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs
--- a/crates/bevy_render/src/lib.rs
+++ b/crates/bevy_render/src/lib.rs
@@ -93,7 +93,7 @@ use std::{
pub struct RenderPlugin {
pub render_creation: RenderCreation,
/// If `true`, disables asynchronous pipeline compilation.
- /// This has no effect on macOS, Wasm, iOS, or without the `multi-threaded` feature.
+ /// This has no effect on macOS, Wasm, iOS, or without the `multi_threaded` feature.
pub synchronous_pipeline_compilation: bool,
}
diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs
--- a/crates/bevy_render/src/render_resource/pipeline_cache.rs
+++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs
@@ -982,7 +982,7 @@ impl PipelineCache {
#[cfg(all(
not(target_arch = "wasm32"),
not(target_os = "macos"),
- feature = "multi-threaded"
+ feature = "multi_threaded"
))]
fn create_pipeline_task(
task: impl Future<Output = Result<Pipeline, PipelineCacheError>> + Send + 'static,
diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs
--- a/crates/bevy_render/src/render_resource/pipeline_cache.rs
+++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs
@@ -1001,7 +1001,7 @@ fn create_pipeline_task(
#[cfg(any(
target_arch = "wasm32",
target_os = "macos",
- not(feature = "multi-threaded")
+ not(feature = "multi_threaded")
))]
fn create_pipeline_task(
task: impl Future<Output = Result<Pipeline, PipelineCacheError>> + Send + 'static,
diff --git a/crates/bevy_tasks/Cargo.toml b/crates/bevy_tasks/Cargo.toml
--- a/crates/bevy_tasks/Cargo.toml
+++ b/crates/bevy_tasks/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
keywords = ["bevy"]
[features]
-multi-threaded = ["dep:async-channel", "dep:concurrent-queue"]
+multi_threaded = ["dep:async-channel", "dep:concurrent-queue"]
[dependencies]
futures-lite = "2.0.1"
diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs
--- a/crates/bevy_tasks/src/lib.rs
+++ b/crates/bevy_tasks/src/lib.rs
@@ -11,14 +11,14 @@ pub use slice::{ParallelSlice, ParallelSliceMut};
mod task;
pub use task::Task;
-#[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+#[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
mod task_pool;
-#[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+#[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
pub use task_pool::{Scope, TaskPool, TaskPoolBuilder};
-#[cfg(any(target_arch = "wasm32", not(feature = "multi-threaded")))]
+#[cfg(any(target_arch = "wasm32", not(feature = "multi_threaded")))]
mod single_threaded_task_pool;
-#[cfg(any(target_arch = "wasm32", not(feature = "multi-threaded")))]
+#[cfg(any(target_arch = "wasm32", not(feature = "multi_threaded")))]
pub use single_threaded_task_pool::{FakeTask, Scope, TaskPool, TaskPoolBuilder, ThreadExecutor};
mod usages;
diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs
--- a/crates/bevy_tasks/src/lib.rs
+++ b/crates/bevy_tasks/src/lib.rs
@@ -26,9 +26,9 @@ mod usages;
pub use usages::tick_global_task_pools_on_main_thread;
pub use usages::{AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool};
-#[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+#[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
mod thread_executor;
-#[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+#[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
pub use thread_executor::{ThreadExecutor, ThreadExecutorTicker};
#[cfg(feature = "async-io")]
diff --git a/docs/cargo_features.md b/docs/cargo_features.md
--- a/docs/cargo_features.md
+++ b/docs/cargo_features.md
@@ -31,7 +31,7 @@ The default feature set enables most of the expected features of a game engine,
|default_font|Include a default font, containing only ASCII characters, at the cost of a 20kB binary size increase|
|hdr|HDR image format support|
|ktx2|KTX2 compressed texture support|
-|multi-threaded|Enables multithreaded parallelism in the engine. Disabling it forces all engine tasks to run on a single thread.|
+|multi_threaded|Enables multithreaded parallelism in the engine. Disabling it forces all engine tasks to run on a single thread.|
|png|PNG image format support|
|sysinfo_plugin|Enables system information diagnostic plugin|
|tonemapping_luts|Include tonemapping Look Up Tables KTX2 files. If everything is pink, you need to enable this feature or change the `Tonemapping` method on your `Camera2dBundle` or `Camera3dBundle`.|
|
diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs
--- a/crates/bevy_asset/src/lib.rs
+++ b/crates/bevy_asset/src/lib.rs
@@ -659,8 +659,8 @@ mod tests {
#[test]
fn load_dependencies() {
// The particular usage of GatedReader in this test will cause deadlocking if running single-threaded
- #[cfg(not(feature = "multi-threaded"))]
- panic!("This test requires the \"multi-threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi-threaded");
+ #[cfg(not(feature = "multi_threaded"))]
+ panic!("This test requires the \"multi_threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi_threaded");
let dir = Dir::default();
diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs
--- a/crates/bevy_asset/src/lib.rs
+++ b/crates/bevy_asset/src/lib.rs
@@ -980,8 +980,8 @@ mod tests {
#[test]
fn failure_load_states() {
// The particular usage of GatedReader in this test will cause deadlocking if running single-threaded
- #[cfg(not(feature = "multi-threaded"))]
- panic!("This test requires the \"multi-threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi-threaded");
+ #[cfg(not(feature = "multi_threaded"))]
+ panic!("This test requires the \"multi_threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi_threaded");
let dir = Dir::default();
diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs
--- a/crates/bevy_asset/src/lib.rs
+++ b/crates/bevy_asset/src/lib.rs
@@ -1145,8 +1145,8 @@ mod tests {
#[test]
fn manual_asset_management() {
// The particular usage of GatedReader in this test will cause deadlocking if running single-threaded
- #[cfg(not(feature = "multi-threaded"))]
- panic!("This test requires the \"multi-threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi-threaded");
+ #[cfg(not(feature = "multi_threaded"))]
+ panic!("This test requires the \"multi_threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi_threaded");
let dir = Dir::default();
let dep_path = "dep.cool.ron";
diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs
--- a/crates/bevy_asset/src/lib.rs
+++ b/crates/bevy_asset/src/lib.rs
@@ -1246,8 +1246,8 @@ mod tests {
#[test]
fn load_folder() {
// The particular usage of GatedReader in this test will cause deadlocking if running single-threaded
- #[cfg(not(feature = "multi-threaded"))]
- panic!("This test requires the \"multi-threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi-threaded");
+ #[cfg(not(feature = "multi_threaded"))]
+ panic!("This test requires the \"multi_threaded\" feature, otherwise it will deadlock.\ncargo test --package bevy_asset --features multi_threaded");
let dir = Dir::default();
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -171,7 +171,7 @@ impl AssetProcessor {
/// * Scan the unprocessed [`AssetReader`] and remove any final processed assets that are invalid or no longer exist.
/// * For each asset in the unprocessed [`AssetReader`], kick off a new "process job", which will process the asset
/// (if the latest version of the asset has not been processed).
- #[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
+ #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
pub fn process_assets(&self) {
let start_time = std::time::Instant::now();
debug!("Processing Assets");
|
multi-threaded feature name is kebab case but all others are snake case
## Bevy version
0.14
## What went wrong
See https://github.com/bevyengine/bevy/blob/62f2a73cac70237c83054345a26b19c9e0a0ee2f/Cargo.toml#L70
|
There are actually quite a few features that use kebab case, such as all the `symphonia-*` ones. Should those also be changed, or just `multi-threaded`?
Oh so there is. We should change all of the ones that aren't deliberately matching a dependencies' feature IMO.
|
2024-04-16T16:04:30Z
|
1.77
|
2024-11-17T23:16:31Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"assets::test::asset_index_round_trip",
"handle::tests::hashing",
"handle::tests::equality",
"handle::tests::conversion",
"handle::tests::ordering",
"id::tests::equality",
"id::tests::hashing",
"id::tests::ordering",
"id::tests::conversion",
"io::embedded::tests::embedded_asset_path_from_external_crate",
"io::embedded::tests::embedded_asset_path_from_external_crate_is_ambiguous",
"io::embedded::tests::embedded_asset_path_from_external_crate_root_src_path",
"io::embedded::tests::embedded_asset_path_from_local_crate",
"io::embedded::tests::embedded_asset_path_from_local_crate_bad_src - should panic",
"io::embedded::tests::embedded_asset_path_from_external_crate_extraneous_beginning_slashes - should panic",
"io::embedded::tests::embedded_asset_path_from_local_crate_blank_src_path_questionable",
"io::embedded::tests::embedded_asset_path_from_local_example_crate",
"path::tests::parse_asset_path",
"path::tests::test_parent",
"path::tests::test_get_extension",
"path::tests::test_resolve_absolute",
"path::tests::test_resolve_asset_source",
"io::memory::test::memory_dir",
"path::tests::test_resolve_canonicalize",
"path::tests::test_resolve_canonicalize_base",
"path::tests::test_resolve_canonicalize_with_source",
"path::tests::test_resolve_explicit_relative",
"path::tests::test_resolve_full",
"path::tests::test_resolve_implicit_relative",
"path::tests::test_resolve_insufficient_elements",
"path::tests::test_resolve_trailing_slash",
"path::tests::test_with_source",
"path::tests::test_resolve_label",
"path::tests::test_without_label",
"server::loaders::tests::path_resolution",
"server::loaders::tests::basic",
"server::loaders::tests::ambiguity_resolution",
"server::loaders::tests::extension_resolution",
"server::loaders::tests::total_resolution",
"server::loaders::tests::type_resolution_shadow",
"server::loaders::tests::type_resolution",
"tests::failure_load_states",
"tests::load_folder",
"tests::keep_gotten_strong_handles",
"tests::manual_asset_management",
"tests::load_dependencies",
"crates/bevy_asset/src/reflect.rs - reflect::ReflectAsset::get_unchecked_mut (line 65) - compile",
"crates/bevy_asset/src/io/embedded/mod.rs - io::embedded::embedded_asset (line 182) - compile",
"crates/bevy_asset/src/reflect.rs - reflect::ReflectHandle (line 182) - compile",
"crates/bevy_asset/src/path.rs - path::AssetPath (line 24) - compile",
"crates/bevy_asset/src/loader.rs - loader::LoadContext<'a>::begin_labeled_asset (line 310) - compile",
"crates/bevy_asset/src/server/mod.rs - server::AssetServer::load_untyped (line 332)",
"crates/bevy_asset/src/path.rs - path::AssetPath<'a>::resolve_embed (line 390)",
"crates/bevy_asset/src/path.rs - path::AssetPath<'a>::resolve (line 340)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 15,546
|
bevyengine__bevy-15546
|
[
"15541"
] |
429987ebf811da7fa30adc57dca5d83ed9c7e871
|
diff --git a/crates/bevy_animation/src/graph.rs b/crates/bevy_animation/src/graph.rs
--- a/crates/bevy_animation/src/graph.rs
+++ b/crates/bevy_animation/src/graph.rs
@@ -508,11 +508,11 @@ impl AssetLoader for AnimationGraphAssetLoader {
type Error = AnimationGraphLoadError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _: &'a Self::Settings,
- load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _: &Self::Settings,
+ load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/crates/bevy_asset/src/loader.rs b/crates/bevy_asset/src/loader.rs
--- a/crates/bevy_asset/src/loader.rs
+++ b/crates/bevy_asset/src/loader.rs
@@ -30,11 +30,11 @@ pub trait AssetLoader: Send + Sync + 'static {
/// The type of [error](`std::error::Error`) which could be encountered by this loader.
type Error: Into<Box<dyn core::error::Error + Send + Sync + 'static>>;
/// Asynchronously loads [`AssetLoader::Asset`] (and any other labeled assets) from the bytes provided by [`Reader`].
- fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- settings: &'a Self::Settings,
- load_context: &'a mut LoadContext,
+ fn load(
+ &self,
+ reader: &mut dyn Reader,
+ settings: &Self::Settings,
+ load_context: &mut LoadContext,
) -> impl ConditionalSendFuture<Output = Result<Self::Asset, Self::Error>>;
/// Returns a list of extensions supported by this [`AssetLoader`], without the preceding dot.
diff --git a/crates/bevy_asset/src/meta.rs b/crates/bevy_asset/src/meta.rs
--- a/crates/bevy_asset/src/meta.rs
+++ b/crates/bevy_asset/src/meta.rs
@@ -173,11 +173,11 @@ impl Process for () {
type Settings = ();
type OutputLoader = ();
- async fn process<'a>(
- &'a self,
- _context: &'a mut bevy_asset::processor::ProcessContext<'_>,
+ async fn process(
+ &self,
+ _context: &mut bevy_asset::processor::ProcessContext<'_>,
_meta: AssetMeta<(), Self>,
- _writer: &'a mut bevy_asset::io::Writer,
+ _writer: &mut bevy_asset::io::Writer,
) -> Result<(), bevy_asset::processor::ProcessError> {
unreachable!()
}
diff --git a/crates/bevy_asset/src/meta.rs b/crates/bevy_asset/src/meta.rs
--- a/crates/bevy_asset/src/meta.rs
+++ b/crates/bevy_asset/src/meta.rs
@@ -196,11 +196,11 @@ impl AssetLoader for () {
type Asset = ();
type Settings = ();
type Error = std::io::Error;
- async fn load<'a>(
- &'a self,
- _reader: &'a mut dyn crate::io::Reader,
- _settings: &'a Self::Settings,
- _load_context: &'a mut crate::LoadContext<'_>,
+ async fn load(
+ &self,
+ _reader: &mut dyn crate::io::Reader,
+ _settings: &Self::Settings,
+ _load_context: &mut crate::LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
unreachable!();
}
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -83,7 +83,7 @@ use thiserror::Error;
/// [`AssetProcessor`] can be run in the background while a Bevy App is running. Changes to assets will be automatically detected and hot-reloaded.
///
/// Assets will only be re-processed if they have been changed. A hash of each asset source is stored in the metadata of the processed version of the
-/// asset, which is used to determine if the asset source has actually changed.
+/// asset, which is used to determine if the asset source has actually changed.
///
/// A [`ProcessorTransactionLog`] is produced, which uses "write-ahead logging" to make the [`AssetProcessor`] crash and failure resistant. If a failed/unfinished
/// transaction from a previous run is detected, the affected asset(s) will be re-processed.
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -155,10 +155,10 @@ impl AssetProcessor {
/// Retrieves the [`AssetSource`] for this processor
#[inline]
- pub fn get_source<'a, 'b>(
- &'a self,
- id: impl Into<AssetSourceId<'b>>,
- ) -> Result<&'a AssetSource, MissingAssetSourceError> {
+ pub fn get_source<'a>(
+ &self,
+ id: impl Into<AssetSourceId<'a>>,
+ ) -> Result<&AssetSource, MissingAssetSourceError> {
self.data.sources.get(id.into())
}
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -565,11 +565,11 @@ impl AssetProcessor {
/// Retrieves asset paths recursively. If `clean_empty_folders_writer` is Some, it will be used to clean up empty
/// folders when they are discovered.
- async fn get_asset_paths<'a>(
- reader: &'a dyn ErasedAssetReader,
- clean_empty_folders_writer: Option<&'a dyn ErasedAssetWriter>,
+ async fn get_asset_paths(
+ reader: &dyn ErasedAssetReader,
+ clean_empty_folders_writer: Option<&dyn ErasedAssetWriter>,
path: PathBuf,
- paths: &'a mut Vec<PathBuf>,
+ paths: &mut Vec<PathBuf>,
) -> Result<bool, AssetReaderError> {
if reader.is_directory(&path).await? {
let mut path_stream = reader.read_directory(&path).await?;
diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs
--- a/crates/bevy_asset/src/processor/mod.rs
+++ b/crates/bevy_asset/src/processor/mod.rs
@@ -1093,11 +1093,11 @@ impl<T: Process> Process for InstrumentedAssetProcessor<T> {
type Settings = T::Settings;
type OutputLoader = T::OutputLoader;
- fn process<'a>(
- &'a self,
- context: &'a mut ProcessContext,
+ fn process(
+ &self,
+ context: &mut ProcessContext,
meta: AssetMeta<(), Self>,
- writer: &'a mut crate::io::Writer,
+ writer: &mut crate::io::Writer,
) -> impl ConditionalSendFuture<
Output = Result<<Self::OutputLoader as crate::AssetLoader>::Settings, ProcessError>,
> {
diff --git a/crates/bevy_asset/src/processor/process.rs b/crates/bevy_asset/src/processor/process.rs
--- a/crates/bevy_asset/src/processor/process.rs
+++ b/crates/bevy_asset/src/processor/process.rs
@@ -27,11 +27,11 @@ pub trait Process: Send + Sync + Sized + 'static {
type OutputLoader: AssetLoader;
/// Processes the asset stored on `context` in some way using the settings stored on `meta`. The results are written to `writer`. The
/// final written processed asset is loadable using [`Process::OutputLoader`]. This load will use the returned [`AssetLoader::Settings`].
- fn process<'a>(
- &'a self,
- context: &'a mut ProcessContext,
+ fn process(
+ &self,
+ context: &mut ProcessContext,
meta: AssetMeta<(), Self>,
- writer: &'a mut Writer,
+ writer: &mut Writer,
) -> impl ConditionalSendFuture<
Output = Result<<Self::OutputLoader as AssetLoader>::Settings, ProcessError>,
>;
diff --git a/crates/bevy_asset/src/processor/process.rs b/crates/bevy_asset/src/processor/process.rs
--- a/crates/bevy_asset/src/processor/process.rs
+++ b/crates/bevy_asset/src/processor/process.rs
@@ -179,11 +179,11 @@ where
LoadTransformAndSaveSettings<Loader::Settings, Transformer::Settings, Saver::Settings>;
type OutputLoader = Saver::OutputLoader;
- async fn process<'a>(
- &'a self,
- context: &'a mut ProcessContext<'_>,
+ async fn process(
+ &self,
+ context: &mut ProcessContext<'_>,
meta: AssetMeta<(), Self>,
- writer: &'a mut Writer,
+ writer: &mut Writer,
) -> Result<<Self::OutputLoader as AssetLoader>::Settings, ProcessError> {
let AssetAction::Process { settings, .. } = meta.asset else {
return Err(ProcessError::WrongMetaType);
diff --git a/crates/bevy_asset/src/saver.rs b/crates/bevy_asset/src/saver.rs
--- a/crates/bevy_asset/src/saver.rs
+++ b/crates/bevy_asset/src/saver.rs
@@ -24,12 +24,12 @@ pub trait AssetSaver: Send + Sync + 'static {
type Error: Into<Box<dyn core::error::Error + Send + Sync + 'static>>;
/// Saves the given runtime [`Asset`] by writing it to a byte format using `writer`. The passed in `settings` can influence how the
- /// `asset` is saved.
- fn save<'a>(
- &'a self,
- writer: &'a mut Writer,
- asset: SavedAsset<'a, Self::Asset>,
- settings: &'a Self::Settings,
+ /// `asset` is saved.
+ fn save(
+ &self,
+ writer: &mut Writer,
+ asset: SavedAsset<'_, Self::Asset>,
+ settings: &Self::Settings,
) -> impl ConditionalSendFuture<
Output = Result<<Self::OutputLoader as AssetLoader>::Settings, Self::Error>,
>;
diff --git a/crates/bevy_asset/src/saver.rs b/crates/bevy_asset/src/saver.rs
--- a/crates/bevy_asset/src/saver.rs
+++ b/crates/bevy_asset/src/saver.rs
@@ -38,7 +38,7 @@ pub trait AssetSaver: Send + Sync + 'static {
/// A type-erased dynamic variant of [`AssetSaver`] that allows callers to save assets without knowing the actual type of the [`AssetSaver`].
pub trait ErasedAssetSaver: Send + Sync + 'static {
/// Saves the given runtime [`ErasedLoadedAsset`] by writing it to a byte format using `writer`. The passed in `settings` can influence how the
- /// `asset` is saved.
+ /// `asset` is saved.
fn save<'a>(
&'a self,
writer: &'a mut Writer,
diff --git a/crates/bevy_asset/src/server/info.rs b/crates/bevy_asset/src/server/info.rs
--- a/crates/bevy_asset/src/server/info.rs
+++ b/crates/bevy_asset/src/server/info.rs
@@ -282,7 +282,7 @@ impl AssetInfos {
pub(crate) fn get_path_and_type_id_handle(
&self,
- path: &AssetPath,
+ path: &AssetPath<'_>,
type_id: TypeId,
) -> Option<UntypedHandle> {
let id = self.path_to_id.get(path)?.get(&type_id)?;
diff --git a/crates/bevy_asset/src/server/info.rs b/crates/bevy_asset/src/server/info.rs
--- a/crates/bevy_asset/src/server/info.rs
+++ b/crates/bevy_asset/src/server/info.rs
@@ -291,7 +291,7 @@ impl AssetInfos {
pub(crate) fn get_path_ids<'a>(
&'a self,
- path: &'a AssetPath<'a>,
+ path: &'a AssetPath<'_>,
) -> impl Iterator<Item = UntypedAssetId> + 'a {
/// Concrete type to allow returning an `impl Iterator` even if `self.path_to_id.get(&path)` is `None`
enum HandlesByPathIterator<T> {
diff --git a/crates/bevy_asset/src/server/info.rs b/crates/bevy_asset/src/server/info.rs
--- a/crates/bevy_asset/src/server/info.rs
+++ b/crates/bevy_asset/src/server/info.rs
@@ -322,7 +322,7 @@ impl AssetInfos {
pub(crate) fn get_path_handles<'a>(
&'a self,
- path: &'a AssetPath<'a>,
+ path: &'a AssetPath<'_>,
) -> impl Iterator<Item = UntypedHandle> + 'a {
self.get_path_ids(path)
.filter_map(|id| self.get_id_handle(id))
diff --git a/crates/bevy_asset/src/server/loaders.rs b/crates/bevy_asset/src/server/loaders.rs
--- a/crates/bevy_asset/src/server/loaders.rs
+++ b/crates/bevy_asset/src/server/loaders.rs
@@ -311,11 +311,11 @@ impl<T: AssetLoader> AssetLoader for InstrumentedAssetLoader<T> {
type Settings = T::Settings;
type Error = T::Error;
- fn load<'a>(
- &'a self,
- reader: &'a mut dyn crate::io::Reader,
- settings: &'a Self::Settings,
- load_context: &'a mut crate::LoadContext,
+ fn load(
+ &self,
+ reader: &mut dyn crate::io::Reader,
+ settings: &Self::Settings,
+ load_context: &mut crate::LoadContext,
) -> impl ConditionalSendFuture<Output = Result<Self::Asset, Self::Error>> {
let span = info_span!(
"asset loading",
diff --git a/crates/bevy_asset/src/server/mod.rs b/crates/bevy_asset/src/server/mod.rs
--- a/crates/bevy_asset/src/server/mod.rs
+++ b/crates/bevy_asset/src/server/mod.rs
@@ -131,10 +131,10 @@ impl AssetServer {
}
/// Retrieves the [`AssetSource`] for the given `source`.
- pub fn get_source<'a, 'b>(
- &'a self,
- source: impl Into<AssetSourceId<'b>>,
- ) -> Result<&'a AssetSource, MissingAssetSourceError> {
+ pub fn get_source<'a>(
+ &self,
+ source: impl Into<AssetSourceId<'a>>,
+ ) -> Result<&AssetSource, MissingAssetSourceError> {
self.data.sources.get(source.into())
}
diff --git a/crates/bevy_asset/src/server/mod.rs b/crates/bevy_asset/src/server/mod.rs
--- a/crates/bevy_asset/src/server/mod.rs
+++ b/crates/bevy_asset/src/server/mod.rs
@@ -218,9 +218,9 @@ impl AssetServer {
}
/// Retrieves the default [`AssetLoader`] for the given path, if one can be found.
- pub async fn get_path_asset_loader<'a, 'b>(
+ pub async fn get_path_asset_loader<'a>(
&self,
- path: impl Into<AssetPath<'b>>,
+ path: impl Into<AssetPath<'a>>,
) -> Result<Arc<dyn ErasedAssetLoader>, MissingAssetLoaderForExtensionError> {
let path = path.into();
diff --git a/crates/bevy_asset/src/server/mod.rs b/crates/bevy_asset/src/server/mod.rs
--- a/crates/bevy_asset/src/server/mod.rs
+++ b/crates/bevy_asset/src/server/mod.rs
@@ -245,7 +245,7 @@ impl AssetServer {
}
/// Retrieves the default [`AssetLoader`] for the given [`Asset`] [`TypeId`], if one can be found.
- pub async fn get_asset_loader_with_asset_type_id<'a>(
+ pub async fn get_asset_loader_with_asset_type_id(
&self,
type_id: TypeId,
) -> Result<Arc<dyn ErasedAssetLoader>, MissingAssetLoaderForTypeIdError> {
diff --git a/crates/bevy_asset/src/server/mod.rs b/crates/bevy_asset/src/server/mod.rs
--- a/crates/bevy_asset/src/server/mod.rs
+++ b/crates/bevy_asset/src/server/mod.rs
@@ -257,7 +257,7 @@ impl AssetServer {
}
/// Retrieves the default [`AssetLoader`] for the given [`Asset`] type, if one can be found.
- pub async fn get_asset_loader_with_asset_type<'a, A: Asset>(
+ pub async fn get_asset_loader_with_asset_type<A: Asset>(
&self,
) -> Result<Arc<dyn ErasedAssetLoader>, MissingAssetLoaderForTypeIdError> {
self.get_asset_loader_with_asset_type_id(TypeId::of::<A>())
diff --git a/crates/bevy_audio/src/audio_source.rs b/crates/bevy_audio/src/audio_source.rs
--- a/crates/bevy_audio/src/audio_source.rs
+++ b/crates/bevy_audio/src/audio_source.rs
@@ -42,11 +42,11 @@ impl AssetLoader for AudioLoader {
type Settings = ();
type Error = std::io::Error;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a Self::Settings,
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &Self::Settings,
+ _load_context: &mut LoadContext<'_>,
) -> Result<AudioSource, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/crates/bevy_audio/src/audio_source.rs b/crates/bevy_audio/src/audio_source.rs
--- a/crates/bevy_audio/src/audio_source.rs
+++ b/crates/bevy_audio/src/audio_source.rs
@@ -111,7 +111,7 @@ pub trait AddAudioSource {
/// so that it can be converted to a [`rodio::Source`] type,
/// and [`Asset`], so that it can be registered as an asset.
/// To use this method on [`App`][bevy_app::App],
- /// the [audio][super::AudioPlugin] and [asset][bevy_asset::AssetPlugin] plugins must be added first.
+ /// the [audio][super::AudioPlugin] and [asset][bevy_asset::AssetPlugin] plugins must be added first.
fn add_audio_source<T>(&mut self) -> &mut Self
where
T: Decodable + Asset,
diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs
--- a/crates/bevy_gltf/src/loader.rs
+++ b/crates/bevy_gltf/src/loader.rs
@@ -179,11 +179,11 @@ impl AssetLoader for GltfLoader {
type Asset = Gltf;
type Settings = GltfLoaderSettings;
type Error = GltfError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- settings: &'a GltfLoaderSettings,
- load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ settings: &GltfLoaderSettings,
+ load_context: &mut LoadContext<'_>,
) -> Result<Gltf, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/crates/bevy_pbr/src/meshlet/asset.rs b/crates/bevy_pbr/src/meshlet/asset.rs
--- a/crates/bevy_pbr/src/meshlet/asset.rs
+++ b/crates/bevy_pbr/src/meshlet/asset.rs
@@ -93,11 +93,11 @@ impl AssetSaver for MeshletMeshSaverLoader {
type OutputLoader = Self;
type Error = MeshletMeshSaveOrLoadError;
- async fn save<'a>(
- &'a self,
- writer: &'a mut Writer,
- asset: SavedAsset<'a, MeshletMesh>,
- _settings: &'a (),
+ async fn save(
+ &self,
+ writer: &mut Writer,
+ asset: SavedAsset<'_, MeshletMesh>,
+ _settings: &(),
) -> Result<(), MeshletMeshSaveOrLoadError> {
// Write asset magic number
writer
diff --git a/crates/bevy_pbr/src/meshlet/asset.rs b/crates/bevy_pbr/src/meshlet/asset.rs
--- a/crates/bevy_pbr/src/meshlet/asset.rs
+++ b/crates/bevy_pbr/src/meshlet/asset.rs
@@ -127,11 +127,11 @@ impl AssetLoader for MeshletMeshSaverLoader {
type Settings = ();
type Error = MeshletMeshSaveOrLoadError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a (),
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &(),
+ _load_context: &mut LoadContext<'_>,
) -> Result<MeshletMesh, MeshletMeshSaveOrLoadError> {
// Load and check magic number
let magic = async_read_u64(reader).await?;
diff --git a/crates/bevy_render/src/render_resource/shader.rs b/crates/bevy_render/src/render_resource/shader.rs
--- a/crates/bevy_render/src/render_resource/shader.rs
+++ b/crates/bevy_render/src/render_resource/shader.rs
@@ -259,11 +259,11 @@ impl AssetLoader for ShaderLoader {
type Asset = Shader;
type Settings = ();
type Error = ShaderLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a Self::Settings,
- load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &Self::Settings,
+ load_context: &mut LoadContext<'_>,
) -> Result<Shader, Self::Error> {
let ext = load_context.path().extension().unwrap().to_str().unwrap();
let path = load_context.asset_path().to_string();
diff --git a/crates/bevy_render/src/texture/compressed_image_saver.rs b/crates/bevy_render/src/texture/compressed_image_saver.rs
--- a/crates/bevy_render/src/texture/compressed_image_saver.rs
+++ b/crates/bevy_render/src/texture/compressed_image_saver.rs
@@ -19,11 +19,11 @@ impl AssetSaver for CompressedImageSaver {
type OutputLoader = ImageLoader;
type Error = CompressedImageSaverError;
- async fn save<'a>(
- &'a self,
- writer: &'a mut bevy_asset::io::Writer,
- image: SavedAsset<'a, Self::Asset>,
- _settings: &'a Self::Settings,
+ async fn save(
+ &self,
+ writer: &mut bevy_asset::io::Writer,
+ image: SavedAsset<'_, Self::Asset>,
+ _settings: &Self::Settings,
) -> Result<ImageLoaderSettings, Self::Error> {
let is_srgb = image.texture_descriptor.format.is_srgb();
diff --git a/crates/bevy_render/src/texture/exr_texture_loader.rs b/crates/bevy_render/src/texture/exr_texture_loader.rs
--- a/crates/bevy_render/src/texture/exr_texture_loader.rs
+++ b/crates/bevy_render/src/texture/exr_texture_loader.rs
@@ -35,11 +35,11 @@ impl AssetLoader for ExrTextureLoader {
type Settings = ExrTextureLoaderSettings;
type Error = ExrTextureLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- settings: &'a Self::Settings,
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ settings: &Self::Settings,
+ _load_context: &mut LoadContext<'_>,
) -> Result<Image, Self::Error> {
let format = TextureFormat::Rgba32Float;
debug_assert_eq!(
diff --git a/crates/bevy_render/src/texture/hdr_texture_loader.rs b/crates/bevy_render/src/texture/hdr_texture_loader.rs
--- a/crates/bevy_render/src/texture/hdr_texture_loader.rs
+++ b/crates/bevy_render/src/texture/hdr_texture_loader.rs
@@ -30,11 +30,11 @@ impl AssetLoader for HdrTextureLoader {
type Asset = Image;
type Settings = HdrTextureLoaderSettings;
type Error = HdrTextureLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- settings: &'a Self::Settings,
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ settings: &Self::Settings,
+ _load_context: &mut LoadContext<'_>,
) -> Result<Image, Self::Error> {
let format = TextureFormat::Rgba32Float;
debug_assert_eq!(
diff --git a/crates/bevy_render/src/texture/image_loader.rs b/crates/bevy_render/src/texture/image_loader.rs
--- a/crates/bevy_render/src/texture/image_loader.rs
+++ b/crates/bevy_render/src/texture/image_loader.rs
@@ -86,11 +86,11 @@ impl AssetLoader for ImageLoader {
type Asset = Image;
type Settings = ImageLoaderSettings;
type Error = ImageLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- settings: &'a ImageLoaderSettings,
- load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ settings: &ImageLoaderSettings,
+ load_context: &mut LoadContext<'_>,
) -> Result<Image, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/crates/bevy_scene/src/scene_loader.rs b/crates/bevy_scene/src/scene_loader.rs
--- a/crates/bevy_scene/src/scene_loader.rs
+++ b/crates/bevy_scene/src/scene_loader.rs
@@ -46,11 +46,11 @@ impl AssetLoader for SceneLoader {
type Settings = ();
type Error = SceneLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a (),
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &(),
+ _load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/crates/bevy_text/src/font_loader.rs b/crates/bevy_text/src/font_loader.rs
--- a/crates/bevy_text/src/font_loader.rs
+++ b/crates/bevy_text/src/font_loader.rs
@@ -22,11 +22,11 @@ impl AssetLoader for FontLoader {
type Asset = Font;
type Settings = ();
type Error = FontLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a (),
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &(),
+ _load_context: &mut LoadContext<'_>,
) -> Result<Font, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/examples/asset/asset_decompression.rs b/examples/asset/asset_decompression.rs
--- a/examples/asset/asset_decompression.rs
+++ b/examples/asset/asset_decompression.rs
@@ -39,11 +39,12 @@ impl AssetLoader for GzAssetLoader {
type Asset = GzAsset;
type Settings = ();
type Error = GzAssetLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a (),
- load_context: &'a mut LoadContext<'_>,
+
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &(),
+ load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
let compressed_path = load_context.path();
let file_name = compressed_path
diff --git a/examples/asset/custom_asset.rs b/examples/asset/custom_asset.rs
--- a/examples/asset/custom_asset.rs
+++ b/examples/asset/custom_asset.rs
@@ -33,11 +33,11 @@ impl AssetLoader for CustomAssetLoader {
type Asset = CustomAsset;
type Settings = ();
type Error = CustomAssetLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a (),
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &(),
+ _load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/examples/asset/custom_asset.rs b/examples/asset/custom_asset.rs
--- a/examples/asset/custom_asset.rs
+++ b/examples/asset/custom_asset.rs
@@ -72,11 +72,11 @@ impl AssetLoader for BlobAssetLoader {
type Settings = ();
type Error = BlobAssetLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a (),
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &(),
+ _load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
info!("Loading Blob...");
let mut bytes = Vec::new();
diff --git a/examples/asset/processing/asset_processing.rs b/examples/asset/processing/asset_processing.rs
--- a/examples/asset/processing/asset_processing.rs
+++ b/examples/asset/processing/asset_processing.rs
@@ -81,11 +81,11 @@ impl AssetLoader for TextLoader {
type Asset = Text;
type Settings = TextSettings;
type Error = std::io::Error;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- settings: &'a TextSettings,
- _load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ settings: &TextSettings,
+ _load_context: &mut LoadContext<'_>,
) -> Result<Text, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/examples/asset/processing/asset_processing.rs b/examples/asset/processing/asset_processing.rs
--- a/examples/asset/processing/asset_processing.rs
+++ b/examples/asset/processing/asset_processing.rs
@@ -135,11 +135,11 @@ impl AssetLoader for CoolTextLoader {
type Settings = ();
type Error = CoolTextLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a Self::Settings,
- load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &Self::Settings,
+ load_context: &mut LoadContext<'_>,
) -> Result<CoolText, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/examples/asset/processing/asset_processing.rs b/examples/asset/processing/asset_processing.rs
--- a/examples/asset/processing/asset_processing.rs
+++ b/examples/asset/processing/asset_processing.rs
@@ -211,11 +211,11 @@ impl AssetSaver for CoolTextSaver {
type OutputLoader = TextLoader;
type Error = std::io::Error;
- async fn save<'a>(
- &'a self,
- writer: &'a mut Writer,
- asset: SavedAsset<'a, Self::Asset>,
- _settings: &'a Self::Settings,
+ async fn save(
+ &self,
+ writer: &mut Writer,
+ asset: SavedAsset<'_, Self::Asset>,
+ _settings: &Self::Settings,
) -> Result<TextSettings, Self::Error> {
writer.write_all(asset.text.as_bytes()).await?;
Ok(TextSettings::default())
|
diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs
--- a/crates/bevy_asset/src/lib.rs
+++ b/crates/bevy_asset/src/lib.rs
@@ -676,11 +676,11 @@ mod tests {
type Error = CoolTextLoaderError;
- async fn load<'a>(
- &'a self,
- reader: &'a mut dyn Reader,
- _settings: &'a Self::Settings,
- load_context: &'a mut LoadContext<'_>,
+ async fn load(
+ &self,
+ reader: &mut dyn Reader,
+ _settings: &Self::Settings,
+ load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
diff --git a/crates/bevy_asset/src/server/loaders.rs b/crates/bevy_asset/src/server/loaders.rs
--- a/crates/bevy_asset/src/server/loaders.rs
+++ b/crates/bevy_asset/src/server/loaders.rs
@@ -383,11 +383,11 @@ mod tests {
type Error = String;
- async fn load<'a>(
- &'a self,
- _: &'a mut dyn crate::io::Reader,
- _: &'a Self::Settings,
- _: &'a mut crate::LoadContext<'_>,
+ async fn load(
+ &self,
+ _: &mut dyn crate::io::Reader,
+ _: &Self::Settings,
+ _: &mut crate::LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
self.sender.send(()).unwrap();
|
AssetServer lifetimes can probably be simplified
> I might be missing something, but I think these can be simplified. There's also other functions in the same file that has unused `'a` lifetimes.
_Originally posted by @kristoff3r in https://github.com/bevyengine/bevy/pull/15533#pullrequestreview-2337163550_
|
2024-09-30T20:18:46Z
|
1.81
|
2024-09-30T22:13:39Z
|
60b2c7ce7755a49381c5265021ff175d3624218c
|
[
"assets::test::asset_index_round_trip",
"handle::tests::equality",
"handle::tests::conversion",
"handle::tests::ordering",
"id::tests::conversion",
"handle::tests::hashing",
"id::tests::equality",
"id::tests::hashing",
"id::tests::ordering",
"io::embedded::tests::embedded_asset_path_from_external_crate",
"io::embedded::tests::embedded_asset_path_from_external_crate_root_src_path",
"io::embedded::tests::embedded_asset_path_from_external_crate_is_ambiguous",
"io::embedded::tests::embedded_asset_path_from_local_crate",
"io::embedded::tests::embedded_asset_path_from_external_crate_extraneous_beginning_slashes - should panic",
"io::embedded::tests::embedded_asset_path_from_local_crate_bad_src - should panic",
"io::embedded::tests::embedded_asset_path_from_local_crate_blank_src_path_questionable",
"io::embedded::tests::embedded_asset_path_from_local_example_crate",
"path::tests::parse_asset_path",
"io::memory::test::memory_dir",
"path::tests::test_parent",
"path::tests::test_get_extension",
"io::embedded::tests::remove_embedded_asset",
"path::tests::test_resolve_absolute",
"path::tests::test_resolve_canonicalize",
"path::tests::test_resolve_asset_source",
"path::tests::test_resolve_canonicalize_base",
"path::tests::test_resolve_canonicalize_with_source",
"path::tests::test_resolve_full",
"path::tests::test_resolve_explicit_relative",
"path::tests::test_resolve_implicit_relative",
"path::tests::test_resolve_insufficient_elements",
"path::tests::test_resolve_label",
"path::tests::test_resolve_trailing_slash",
"path::tests::test_with_source",
"path::tests::test_without_label",
"server::loaders::tests::basic",
"server::loaders::tests::extension_resolution",
"server::loaders::tests::ambiguity_resolution",
"server::loaders::tests::path_resolution",
"server::loaders::tests::type_resolution_shadow",
"server::loaders::tests::type_resolution",
"server::loaders::tests::total_resolution",
"handle::tests::strong_handle_reflect_clone",
"reflect::tests::test_reflect_asset_operations",
"tests::ignore_system_ambiguities_on_assets",
"tests::failure_load_states",
"tests::dependency_load_states",
"tests::load_folder",
"tests::load_dependencies",
"tests::keep_gotten_strong_handles",
"tests::manual_asset_management",
"tests::load_error_events",
"crates/bevy_asset/src/reflect.rs - reflect::ReflectHandle (line 189) - compile",
"crates/bevy_asset/src/reflect.rs - reflect::ReflectAsset::get_unchecked_mut (line 70) - compile",
"crates/bevy_asset/src/server/mod.rs - server::AssetServer::load (line 296) - compile",
"crates/bevy_asset/src/server/mod.rs - server::AssetServer::load (line 278) - compile",
"crates/bevy_asset/src/io/embedded/mod.rs - io::embedded::embedded_asset (line 206) - compile",
"crates/bevy_asset/src/io/mod.rs - io::AssetReader::read (line 145) - compile",
"crates/bevy_asset/src/path.rs - path::AssetPath (line 24) - compile",
"crates/bevy_asset/src/loader.rs - loader::LoadContext<'a>::begin_labeled_asset (line 353) - compile",
"crates/bevy_asset/src/server/mod.rs - server::AssetServer::load_untyped (line 476)",
"crates/bevy_asset/src/path.rs - path::AssetPath<'a>::resolve (line 341)",
"crates/bevy_asset/src/path.rs - path::AssetPath<'a>::resolve_embed (line 391)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 15,405
|
bevyengine__bevy-15405
|
[
"14300"
] |
efda7f3f9c96164f6e5be04d2be9c267919c6a0a
|
diff --git a/crates/bevy_ecs/src/entity/map_entities.rs b/crates/bevy_ecs/src/entity/map_entities.rs
--- a/crates/bevy_ecs/src/entity/map_entities.rs
+++ b/crates/bevy_ecs/src/entity/map_entities.rs
@@ -183,6 +183,9 @@ impl<'m> SceneEntityMapper<'m> {
/// Creates a new [`SceneEntityMapper`], spawning a temporary base [`Entity`] in the provided [`World`]
pub fn new(map: &'m mut EntityHashMap<Entity>, world: &mut World) -> Self {
+ // We're going to be calling methods on `Entities` that require advance
+ // flushing, such as `alloc` and `free`.
+ world.flush_entities();
Self {
map,
// SAFETY: Entities data is kept in a valid state via `EntityMapper::world_scope`
|
diff --git a/crates/bevy_ecs/src/entity/map_entities.rs b/crates/bevy_ecs/src/entity/map_entities.rs
--- a/crates/bevy_ecs/src/entity/map_entities.rs
+++ b/crates/bevy_ecs/src/entity/map_entities.rs
@@ -292,6 +295,23 @@ mod tests {
);
}
+ #[test]
+ fn entity_mapper_no_panic() {
+ let mut world = World::new();
+ // "Dirty" the `Entities`, requiring a flush afterward.
+ world.entities.reserve_entity();
+ assert!(world.entities.needs_flush());
+
+ // Create and exercise a SceneEntityMapper - should not panic because it flushes
+ // `Entities` first.
+ SceneEntityMapper::world_scope(&mut Default::default(), &mut world, |_, m| {
+ m.map_entity(Entity::PLACEHOLDER);
+ });
+
+ // The SceneEntityMapper should leave `Entities` in a flushed state.
+ assert!(!world.entities.needs_flush());
+ }
+
#[test]
fn dyn_entity_mapper_object_safe() {
assert_object_safe::<dyn DynEntityMapper>();
diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs
--- a/crates/bevy_scene/src/dynamic_scene.rs
+++ b/crates/bevy_scene/src/dynamic_scene.rs
@@ -209,14 +209,19 @@ where
#[cfg(test)]
mod tests {
use bevy_ecs::{
+ component::Component,
entity::{Entity, EntityHashMap, EntityMapper, MapEntities},
- reflect::{AppTypeRegistry, ReflectMapEntitiesResource, ReflectResource},
+ reflect::{
+ AppTypeRegistry, ReflectComponent, ReflectMapEntities, ReflectMapEntitiesResource,
+ ReflectResource,
+ },
system::Resource,
world::{Command, World},
};
use bevy_hierarchy::{AddChild, Parent};
use bevy_reflect::Reflect;
+ use crate::dynamic_scene::DynamicScene;
use crate::dynamic_scene_builder::DynamicSceneBuilder;
#[derive(Resource, Reflect, Debug)]
diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs
--- a/crates/bevy_scene/src/dynamic_scene.rs
+++ b/crates/bevy_scene/src/dynamic_scene.rs
@@ -348,4 +353,51 @@ mod tests {
"something is wrong with the this test or the code reloading scenes since the relationship between scene entities is broken"
);
}
+
+ // Regression test for https://github.com/bevyengine/bevy/issues/14300
+ // Fails before the fix in https://github.com/bevyengine/bevy/pull/15405
+ #[test]
+ fn no_panic_in_map_entities_after_pending_entity_in_hook() {
+ #[derive(Default, Component, Reflect)]
+ #[reflect(Component)]
+ struct A;
+
+ #[derive(Component, Reflect)]
+ #[reflect(Component, MapEntities)]
+ struct B(pub Entity);
+
+ impl MapEntities for B {
+ fn map_entities<M: EntityMapper>(&mut self, entity_mapper: &mut M) {
+ self.0 = entity_mapper.map_entity(self.0);
+ }
+ }
+
+ let reg = AppTypeRegistry::default();
+ {
+ let mut reg_write = reg.write();
+ reg_write.register::<A>();
+ reg_write.register::<B>();
+ }
+
+ let mut scene_world = World::new();
+ scene_world.insert_resource(reg.clone());
+ scene_world.spawn((B(Entity::PLACEHOLDER), A));
+ let scene = DynamicScene::from_world(&scene_world);
+
+ let mut dst_world = World::new();
+ dst_world
+ .register_component_hooks::<A>()
+ .on_add(|mut world, _, _| {
+ world.commands().spawn_empty();
+ });
+ dst_world.insert_resource(reg.clone());
+
+ // Should not panic.
+ // Prior to fix, the `Entities::alloc` call in
+ // `EntityMapper::map_entity` would panic due to pending entities from the observer
+ // not having been flushed.
+ scene
+ .write_to_world(&mut dst_world, &mut Default::default())
+ .unwrap();
+ }
}
|
Panic calling `DynamicScene::write_to_world` with `MapEntities` and `ComponentHooks`
## Bevy version
`0.14.0`
## What you did
- call `DynamicScene::write_to_world` with two components:
1. One that uses `MapEntities`
2. One that calls `world.commands().spawn_empty()` in `ComponentHooks::on_add`
## What went wrong
Panics at `bevy_ecs::entity::Entities::verify_flushed`, traced back to `scene::write_to_world`
```
thread 'main' panicked at C:\work-ref\bevy\crates\bevy_ecs\src\entity\mod.rs:582:9:
flush() needs to be called before this operation is legal
```
## Additional information
I dont know enough about the ecs internals to understand whats happening, possibly commands from the DeferredWorld in `ComponentHooks::on_add` are being called at an inappropriate time?
## Full reproducible
```rust
use bevy::ecs::entity::MapEntities;
use bevy::ecs::reflect::ReflectMapEntities;
use bevy::prelude::*;
#[derive(Default, Component, Reflect)]
#[reflect(Component)]
struct CompA;
#[derive(Component, Reflect)]
// #[reflect(Component)] // OK
#[reflect(Component, MapEntities)] // Breaks
struct CompB(pub Entity);
impl MapEntities for CompB {
fn map_entities<M: EntityMapper>(&mut self, entity_mapper: &mut M) {
self.0 = entity_mapper.map_entity(self.0);
}
}
fn main() {
let mut app = App::new();
app.register_type::<CompA>().register_type::<CompB>();
let world = app.world_mut();
world
.register_component_hooks::<CompA>()
.on_add(|mut world, _, _| {
world
.commands()
.spawn_empty();
});
world.spawn((CompB(Entity::PLACEHOLDER), CompA));
let scene = DynamicScene::from_world(world);
scene.write_to_world(world, &mut default()).unwrap();
}
```
|
looks related to https://github.com/bevyengine/bevy/issues/14465
|
2024-09-24T00:11:46Z
|
1.81
|
2024-09-24T17:54:36Z
|
60b2c7ce7755a49381c5265021ff175d3624218c
|
[
"entity::map_entities::tests::entity_mapper_no_panic"
] |
[
"change_detection::tests::as_deref_mut",
"bundle::tests::component_hook_order_spawn_despawn",
"bundle::tests::component_hook_order_insert_remove",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"bundle::tests::component_hook_order_replace",
"bundle::tests::insert_if_new",
"bundle::tests::component_hook_order_recursive",
"change_detection::tests::map_mut",
"bundle::tests::component_hook_order_recursive_multiple",
"change_detection::tests::change_tick_scan",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::change_expiration",
"change_detection::tests::mut_new",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_untyped_to_reflect",
"entity::map_entities::tests::dyn_entity_mapper_object_safe",
"change_detection::tests::set_if_neq",
"entity::map_entities::tests::entity_mapper",
"entity::map_entities::tests::entity_mapper_iteration",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_comparison",
"entity::tests::entity_const",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::tests::entity_debug",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::test_event_cursor_iter_len_updated",
"event::tests::test_event_cursor_clear",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_cursor_len_current",
"event::tests::test_event_cursor_len_empty",
"event::tests::test_event_cursor_len_filled",
"event::tests::test_event_cursor_len_update",
"event::tests::test_event_cursor_read",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_events",
"event::tests::test_event_reader_iter_last",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_events_send_default",
"event::tests::test_events_update_drain",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::id_comparison",
"identifier::tests::from_bits",
"identifier::tests::id_construction",
"intern::tests::different_interned_content",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"intern::tests::zero_sized_type",
"label::tests::dyn_eq_object_safe",
"label::tests::dyn_hash_object_safe",
"observer::tests::observer_despawn",
"query::access::tests::filtered_combined_access",
"observer::tests::observer_dynamic_trigger",
"query::access::tests::test_access_clone_from",
"query::access::tests::test_access_clone",
"query::access::tests::read_all_access_conflicts",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_access_extend",
"observer::tests::observer_despawn_archetype_flags",
"observer::tests::observer_trigger_ref",
"query::access::tests::access_get_conflicts",
"observer::tests::observer_multiple_matches",
"observer::tests::observer_multiple_listeners",
"observer::tests::observer_entity_routing",
"observer::tests::observer_propagating_world",
"query::access::tests::test_access_filters_clone",
"observer::tests::observer_dynamic_component",
"observer::tests::observer_multiple_events",
"observer::tests::observer_order_insert_remove",
"observer::tests::observer_multiple_components",
"observer::tests::observer_order_replace",
"observer::tests::observer_no_target",
"observer::tests::observer_order_insert_remove_sparse",
"observer::tests::observer_on_remove_during_despawn_spawn_empty",
"observer::tests::observer_propagating_world_skipping",
"observer::tests::observer_propagating",
"query::access::tests::test_filtered_access_set_clone",
"observer::tests::observer_propagating_parallel_propagation",
"observer::tests::observer_propagating_no_next",
"query::access::tests::test_filtered_access_set_from",
"observer::tests::observer_trigger_targets_ref",
"observer::tests::observer_order_spawn_despawn",
"query::access::tests::test_access_filters_clone_from",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"observer::tests::observer_order_recursive",
"query::access::tests::test_filtered_access_clone_from",
"query::access::tests::test_filtered_access_clone",
"observer::tests::observer_propagating_halt",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"query::fetch::tests::world_query_struct_variants",
"query::fetch::tests::world_query_phantom_data",
"query::fetch::tests::read_only_field_visibility",
"query::builder::tests::builder_dynamic_components",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"query::builder::tests::builder_with_without_static",
"query::builder::tests::builder_static_components",
"observer::tests::observer_propagating_join",
"query::builder::tests::builder_with_without_dynamic",
"query::builder::tests::builder_static_dense_dynamic_sparse",
"query::fetch::tests::world_query_metadata_collision",
"query::builder::tests::builder_or",
"query::builder::tests::builder_transmute",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::state::tests::can_generalize_with_option",
"query::iter::tests::query_sorts",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_added",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_mut_fetch",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::iter::tests::query_sort_after_next - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::join",
"query::state::tests::join_with_get",
"query::tests::any_query",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::transmute_from_sparse_to_dense",
"query::state::tests::transmute_with_different_world - should panic",
"query::tests::has_query",
"query::tests::query_iter_combinations_sparse",
"query::state::tests::transmute_from_dense_to_sparse",
"query::tests::query",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"query::tests::query_iter_combinations",
"query::tests::many_entities",
"query::tests::self_conflicting_worldquery - should panic",
"schedule::condition::tests::distributive_run_if_compiles",
"reflect::entity_commands::tests::remove_reflected_bundle",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::remove_reflected_bundle_with_registry",
"query::tests::multi_storage_query",
"reflect::entity_commands::tests::insert_reflect_bundle_with_registry",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::insert_reflect_bundle",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"query::tests::query_filtered_iter_combinations",
"query::tests::derived_worldqueries",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::set::tests::test_derive_schedule_label",
"schedule::set::tests::test_derive_system_set",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::clear_schedule",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::stepping::tests::continue_always_run",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::stepping::tests::unknown_schedule",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::stepping_disabled",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::stepping::tests::step_never_run",
"schedule::stepping::tests::waiting_always_run",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::stepping::tests::step_always_run",
"schedule::tests::stepping::simple_executor",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::system_ambiguity::events",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::read_component_and_entity_mut",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::system_ambiguity::resource_and_entity_mut",
"schedule::tests::system_ambiguity::shared_resource_mut_component",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::stepping::tests::step_breakpoint",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::stepping::multi_threaded_executor",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::executor::tests::invalid_condition_param_skips_system",
"schedule::tests::system_ambiguity::resource_mut_and_entity_ref",
"schedule::tests::system_ambiguity::write_component_and_entity_ref",
"storage::blob_vec::tests::blob_vec",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::system_ambiguity::resources",
"storage::blob_vec::tests::resize_test",
"schedule::tests::system_ambiguity::read_world",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::schedule::tests::disable_auto_sync_points",
"system::builder::tests::param_set_vec_builder",
"storage::sparse_set::tests::sparse_set",
"schedule::stepping::tests::verify_cursor",
"storage::sparse_set::tests::sparse_sets",
"system::builder::tests::query_builder",
"system::commands::tests::append",
"system::builder::tests::query_builder_state",
"event::tests::test_event_mutator_iter_nth",
"schedule::condition::tests::multiple_run_conditions",
"system::builder::tests::custom_param_builder",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"schedule::tests::system_execution::run_system",
"schedule::tests::conditions::system_with_condition",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"event::tests::test_event_reader_iter_nth",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::builder::tests::vec_builder",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"schedule::schedule::tests::inserts_a_sync_point",
"storage::blob_array::tests::make_sure_zst_components_get_dropped - should panic",
"system::builder::tests::local_builder",
"system::commands::tests::test_commands_are_send_and_sync",
"system::commands::tests::remove_resources",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"schedule::tests::conditions::multiple_conditions_on_system",
"system::commands::tests::entity_commands_entry",
"schedule::stepping::tests::step_run_if_false",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"system::system::tests::command_processing",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"storage::table::tests::table",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"system::function_system::tests::into_system_type_id_consistency",
"system::builder::tests::dyn_builder",
"system::system::tests::run_two_systems",
"schedule::tests::system_ambiguity::correct_ambiguities",
"system::system_name::tests::test_closure_system_name_regular_param",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"system::commands::tests::insert_components",
"schedule::tests::conditions::system_conditions_and_change_detection",
"system::system::tests::non_send_resources",
"schedule::schedule::tests::configure_set_on_new_schedule",
"system::system_name::tests::test_system_name_regular_param",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"system::builder::tests::multi_param_builder",
"system::system_param::tests::system_param_flexibility",
"system::system::tests::run_system_once",
"system::commands::tests::remove_components_by_id",
"system::commands::tests::commands",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"system::system_param::tests::system_param_const_generics",
"schedule::executor::tests::invalid_system_param_skips",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"system::system_name::tests::test_system_name_exclusive_param",
"system::system_param::tests::system_param_generic_bounds",
"schedule::set::tests::test_schedule_label",
"schedule::executor::multi_threaded::tests::check_spawn_exclusive_system_task_miri",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"system::commands::tests::remove_components",
"system::builder::tests::param_set_builder",
"system::builder::tests::multi_param_builder_inference",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"system::system_param::tests::system_param_field_limit",
"system::system_param::tests::non_sync_local",
"system::system_param::tests::param_set_non_send_first",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"system::system_param::tests::system_param_phantom_data",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"system::system_param::tests::system_param_struct_variants",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_name_collision",
"system::system_registry::tests::cached_system",
"system::system_registry::tests::change_detection",
"system::system_param::tests::param_set_non_send_second",
"schedule::tests::system_ordering::add_systems_correct_order",
"system::system_registry::tests::local_variables",
"schedule::tests::system_ambiguity::read_only",
"schedule::condition::tests::run_condition",
"system::system_registry::tests::output_values",
"schedule::tests::system_ordering::order_systems",
"system::system_registry::tests::exclusive_system",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::system_registry::tests::input_values",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::nested_systems_with_inputs",
"system::system_registry::tests::system_with_input_ref",
"system::system_registry::tests::system_with_input_mut",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::assert_entity_mut_system_does_conflict - should panic",
"schedule::condition::tests::run_condition_combinators",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::any_of_with_empty_and_mut",
"system::tests::assert_world_and_entity_mut_system_does_conflict - should panic",
"system::tests::assert_entity_ref_and_entity_mut_system_does_conflict - should panic",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::assert_systems",
"schedule::schedule::tests::no_sync_chain::chain_all",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::any_of_with_and_without_common",
"system::tests::any_of_and_without",
"system::tests::get_system_conflicts",
"system::tests::conflicting_system_resources - should panic",
"system::tests::long_life_test",
"system::tests::immutable_mut_test",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::any_of_with_mut_and_ref - should panic",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::any_of_with_ref_and_mut - should panic",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::any_of_working",
"system::tests::any_of_with_entity_and_mut",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::disjoint_query_mut_read_component_system",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"event::tests::test_event_cursor_par_read_mut",
"system::tests::can_have_16_parameters",
"system::tests::convert_mut_to_immut",
"system::tests::commands_param_set",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::non_send_system",
"system::tests::changed_resource_system",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::nonconflicting_system_resources",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"query::tests::par_iter_mut_change_detection",
"system::tests::pipe_change_detection",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::disjoint_query_mut_system",
"system::tests::into_iter_impl",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::non_send_option_system",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"event::tests::test_event_cursor_par_read",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::local_system",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::system_state_archetype_update",
"system::tests::query_validates_world_id - should panic",
"system::tests::system_state_change_detection",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::query_set_system",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::panic_inside_system - should panic",
"system::tests::or_expanded_with_and_without_common",
"system::tests::simple_system",
"system::tests::read_system_state",
"system::tests::system_state_invalid_world - should panic",
"system::tests::query_is_empty",
"system::tests::or_param_set_system",
"system::tests::or_has_filter_with",
"system::tests::write_system_state",
"system::tests::update_archetype_component_access_works",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::removal_tracking",
"tests::changed_query",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"tests::added_queries",
"query::tests::query_filtered_exactsizeiterator_len",
"tests::added_tracking",
"tests::despawn_mixed_storage",
"tests::despawn_table_storage",
"tests::clear_entities",
"tests::duplicate_components_panic - should panic",
"tests::dynamic_required_components",
"tests::add_remove_components",
"system::tests::test_combinator_clone",
"tests::bundle_derive",
"tests::entity_ref_and_entity_ref_query_no_panic",
"tests::entity_mut_and_entity_mut_query_panic - should panic",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::empty_spawn",
"tests::filtered_query_access",
"tests::entity_ref_and_entity_mut_query_panic - should panic",
"tests::changed_trackers_sparse",
"system::tests::world_collections_system",
"tests::generic_required_components",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop",
"tests::insert_overwrite_drop_sparse",
"tests::exact_size_query",
"tests::insert_or_spawn_batch_invalid",
"tests::changed_trackers",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::non_send_resource",
"tests::non_send_resource_points_to_distinct_data",
"tests::query_all",
"tests::query_filter_with",
"tests::query_filters_dont_collide_with_fetches",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::par_for_each_dense",
"tests::query_filter_with_for_each",
"tests::query_all_for_each",
"tests::query_filter_without",
"tests::query_filter_with_sparse",
"tests::query_missing_component",
"tests::par_for_each_sparse",
"tests::query_get_works_across_sparse_removal",
"tests::non_send_resource_panic - should panic",
"tests::query_optional_component_sparse",
"tests::query_filter_with_sparse_for_each",
"tests::query_get",
"tests::query_optional_component_table",
"tests::query_optional_component_sparse_no_match",
"tests::ref_and_mut_query_panic - should panic",
"tests::query_single_component_for_each",
"tests::query_single_component",
"tests::random_access",
"tests::query_sparse_component",
"tests::remove",
"tests::required_components",
"tests::required_components_spawn_nonexistent_hooks",
"tests::remove_missing",
"tests::required_components_retain_keeps_required",
"tests::required_components_insert_existing_hooks",
"tests::required_components_take_leaves_required",
"tests::required_components_spawn_then_insert_no_overwrite",
"tests::remove_tracking",
"tests::resource",
"tests::reserve_and_spawn",
"tests::resource_scope",
"world::command_queue::test::test_command_is_send",
"tests::sparse_set_add_remove_many",
"tests::reserve_entities_across_worlds",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_queue_inner",
"tests::spawn_batch",
"tests::take",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_except",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_except_conflicts_with_other - should panic",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_except_doesnt_conflict",
"world::entity_ref::tests::entity_mut_except_conflicts_with_self - should panic",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_ref_except_conflicts_with_self - should panic",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_except",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::entity_ref_except_conflicts_with_other - should panic",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::entity_ref_except_doesnt_conflict",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::get_components",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_system_param",
"world::identifier::tests::world_id_exclusive_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::get_resource_mut_by_id",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iter_resources",
"world::tests::iter_resources_mut",
"world::reflect::tests::get_component_as_mut_reflect",
"world::reflect::tests::get_component_as_reflect",
"world::tests::spawn_empty_bundle",
"world::tests::panic_while_overwriting_component",
"world::tests::test_verify_unique_entities",
"world::tests::iterate_entities_mut",
"world::tests::inspect_entity_components",
"world::tests::iterate_entities",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 1237) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 305) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1029) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 240) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1037) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 108) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 250) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 40)",
"crates/bevy_ecs/src/component.rs - component::Component (line 90)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 100)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper::mappings (line 88)",
"crates/bevy_ecs/src/component.rs - component::Component (line 44)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 60)",
"crates/bevy_ecs/src/component.rs - component::Component (line 246)",
"crates/bevy_ecs/src/component.rs - component::Component (line 315)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 355)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 93)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/lib.rs - (line 166)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/component.rs - component::Component (line 280)",
"crates/bevy_ecs/src/lib.rs - (line 286)",
"crates/bevy_ecs/src/lib.rs - (line 238)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 124)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1253)",
"crates/bevy_ecs/src/lib.rs - (line 190)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 723)",
"crates/bevy_ecs/src/observer/mod.rs - observer::Trigger<'w,E,B>::observer (line 78)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 199)",
"crates/bevy_ecs/src/lib.rs - (line 213)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 224)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 40)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 574)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 789)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 214) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 266) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 184) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 236) - compile fail",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1512)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining_mut (line 100)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining (line 63)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 412) - compile fail",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 379) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 431) - compile fail",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 33)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 121)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1498)",
"crates/bevy_ecs/src/label.rs - label::define_label (line 65)",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 26)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 971)",
"crates/bevy_ecs/src/component.rs - component::Component (line 198)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 1009)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 129)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 961)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 598)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 210)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 814)",
"crates/bevy_ecs/src/lib.rs - (line 335)",
"crates/bevy_ecs/src/component.rs - component::Component (line 108)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 207)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 818)",
"crates/bevy_ecs/src/component.rs - component::Component (line 150)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 106)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 222)",
"crates/bevy_ecs/src/component.rs - component::Component (line 128)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 229)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 247)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 144)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 344)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1860)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 123)",
"crates/bevy_ecs/src/component.rs - component::Component (line 172)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 191)",
"crates/bevy_ecs/src/lib.rs - (line 125)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 769)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 133)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 118)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 173)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 66)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 841)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 88)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 141)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 153)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 210)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 254)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1883)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 237)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 12)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 668)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 67)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 103)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 705)",
"crates/bevy_ecs/src/lib.rs - (line 310)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 648)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 271) - compile fail",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 159)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 392)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1417)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed (line 1081)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 82)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 116)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 993)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 152)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 288)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 715)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 101)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 584)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 949)",
"crates/bevy_ecs/src/lib.rs - (line 253)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 556)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 812)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1040)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 622)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 665)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 335)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 911) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 769)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 545)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1022) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 518)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 556)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed_to (line 1132)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 830)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 897)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::reborrow (line 416)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 394)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 14)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 15)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 402)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 507)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 497)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 621)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert (line 1183)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 344)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 648)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 48)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 554) - compile fail",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 244)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 1001)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::remove (line 1327)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::retain (line 1435)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert_if (line 1231)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 143)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert_if_new_and (line 1278)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 289)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::entry (line 963)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1859) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 933)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::queue (line 1411)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 250)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 230)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::despawn (line 1387)",
"crates/bevy_ecs/src/system/input.rs - system::input::InRef (line 106)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 565)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 455)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 176)",
"crates/bevy_ecs/src/system/input.rs - system::input::InMut (line 157)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 676)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemParamBuilder (line 18)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 279)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 854)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 737)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::queue (line 539)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 44)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1835)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 19)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 186)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert_if (line 1056)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 146)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 964)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 238)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 485)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1284)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 68)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1527)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_system (line 737)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 447)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 843)",
"crates/bevy_ecs/src/system/input.rs - system::input::In (line 54)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 261)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1249)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1178)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 589)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1570)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 129) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 643)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1208)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 50)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 806)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1131)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 229)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1103)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 294)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 274)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 402)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1327)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1424)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 876)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1415)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 899)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 129)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 315)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1591)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 373)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::DynSystemParam (line 1978)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1057)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 437)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 207)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1650)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1110)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1736)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 295)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 248)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 525)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1078)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 1007)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 414)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 224)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 835)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 541)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 27)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 375)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 2602)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 78)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1676)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 804)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2503)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 470)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1979)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 468)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1477)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1621)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1025)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 273)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1769)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 30)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 2280)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 698)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1816)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1163)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1260)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 746)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 423)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 926)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 611)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 576)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1814)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1709)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2525)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1793)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 893)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1565)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 457)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1873)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 341)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1848)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1229)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2865)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1193)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 15,398
|
bevyengine__bevy-15398
|
[
"14467"
] |
1a41c736b39a01f4dbef75c4282edf3ced5f01e9
|
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -1297,7 +1297,6 @@ impl<'w> EntityWorldMut<'w> {
/// See [`World::despawn`] for more details.
pub fn despawn(self) {
let world = self.world;
- world.flush_entities();
let archetype = &world.archetypes[self.location.archetype_id];
// SAFETY: Archetype cannot be mutably aliased by DeferredWorld
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -1323,6 +1322,10 @@ impl<'w> EntityWorldMut<'w> {
world.removed_components.send(component_id, self.entity);
}
+ // Observers and on_remove hooks may reserve new entities, which
+ // requires a flush before Entities::free may be called.
+ world.flush_entities();
+
let location = world
.entities
.free(self.entity)
|
diff --git a/crates/bevy_ecs/src/observer/mod.rs b/crates/bevy_ecs/src/observer/mod.rs
--- a/crates/bevy_ecs/src/observer/mod.rs
+++ b/crates/bevy_ecs/src/observer/mod.rs
@@ -1160,4 +1160,26 @@ mod tests {
world.flush();
assert_eq!(vec!["event", "event"], world.resource::<Order>().0);
}
+
+ // Regression test for https://github.com/bevyengine/bevy/issues/14467
+ // Fails prior to https://github.com/bevyengine/bevy/pull/15398
+ #[test]
+ fn observer_on_remove_during_despawn_spawn_empty() {
+ let mut world = World::new();
+
+ // Observe the removal of A - this will run during despawn
+ world.observe(|_: Trigger<OnRemove, A>, mut cmd: Commands| {
+ // Spawn a new entity - this reserves a new ID and requires a flush
+ // afterward before Entities::free can be called.
+ cmd.spawn_empty();
+ });
+
+ let ent = world.spawn(A).id();
+
+ // Despawn our entity, which runs the OnRemove observer and allocates a
+ // new Entity.
+ // Should not panic - if it does, then Entities was not flushed properly
+ // after the observer's spawn_empty.
+ world.despawn(ent);
+ }
}
|
Panic when a despawning `Entity`'s observer spawns an `Entity`
## Bevy version
`0.14.0`
## What you did
```rust
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(MinimalPlugins)
.add_systems(Startup, startup)
.add_systems(Update, update)
.run();
}
#[derive(Component)]
struct Marker;
fn startup(mut commands: Commands) {
commands.spawn(Marker).observe(|_: Trigger<OnRemove, Marker>, mut commands: Commands| {
commands.spawn_empty();
});
}
fn update(
query: Query<Entity, With<Marker>>,
mut commands: Commands
) {
for entity in &query {
commands.entity(entity).despawn();
}
}
```
## What went wrong
### What were you expecting?
1. Entity with `Marker` component gets queued for despawning.
2. Its observer runs and queues the spawning of a new entity.
3. End result is the entity with `Marker` being despawned, and a new empty entity being spawned.
4. App continues to run.
### What actually happened?
```
thread 'main' panicked at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.14.0\src\entity\mod.rs:582:9:
flush() needs to be called before this operation is legal
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic when applying buffers for system `flush_panic_repro::update`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
error: process didn't exit successfully: `target\debug\flush_panic_repro.exe` (exit code: 101)
```
## Additional information
#14300 runs into the same panic, but involves component hooks, `MapEntities`, and `DynamicScene`. I don't know enough about Bevy's internals to know if these are ultimately the same bug, or just coincidentally panic in the same spot.
---
If just the `Marker` component is removed without despawning its entity, the observer still runs (as expected) but there is no panic:
```rust
fn update(
query: Query<Entity, With<Marker>>,
mut commands: Commands
) {
for entity in &query {
commands.entity(entity).remove::<Marker>(); // Does NOT panic.
}
}
// Rest of code is unchanged.
```
---
Here's what seems like the most relevant part of the panic backtrace:
```
2: bevy_ecs::entity::Entities::verify_flushed
at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.14.0\src\entity\mod.rs:582
3: bevy_ecs::entity::Entities::free
at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.14.0\src\entity\mod.rs:680
4: bevy_ecs::world::entity_ref::EntityWorldMut::despawn
at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.14.0\src\world\entity_ref.rs:1235
5: bevy_ecs::world::World::despawn
at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.14.0\src\world\mod.rs:1105
6: bevy_ecs::system::commands::despawn
at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.14.0\src\system\commands\mod.rs:1241
```
|
2024-09-23T20:28:24Z
|
1.81
|
2024-09-24T01:25:13Z
|
60b2c7ce7755a49381c5265021ff175d3624218c
|
[
"observer::tests::observer_on_remove_during_despawn_spawn_empty"
] |
[
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::map_mut",
"change_detection::tests::change_tick_scan",
"bundle::tests::component_hook_order_replace",
"bundle::tests::component_hook_order_recursive_multiple",
"entity::map_entities::tests::entity_mapper",
"entity::map_entities::tests::entity_mapper_iteration",
"entity::tests::entity_bits_roundtrip",
"change_detection::tests::as_deref_mut",
"change_detection::tests::set_if_neq",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_new",
"change_detection::tests::mut_from_res_mut",
"bundle::tests::insert_if_new",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"entity::tests::entity_const",
"entity::tests::entity_niche_optimization",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"event::tests::test_event_cursor_len_filled",
"bundle::tests::component_hook_order_spawn_despawn",
"bundle::tests::component_hook_order_insert_remove",
"event::tests::test_event_cursor_len_current",
"event::tests::test_event_cursor_iter_len_updated",
"entity::tests::entity_display",
"entity::tests::reserve_generations_and_alloc",
"entity::tests::reserve_generations",
"bundle::tests::component_hook_order_recursive",
"entity::tests::entity_comparison",
"entity::tests::reserve_entity_len",
"entity::tests::get_reserved_and_invalid",
"event::tests::test_event_cursor_read",
"event::tests::test_events_empty",
"identifier::masks::tests::get_u64_parts",
"event::tests::test_event_cursor_len_empty",
"entity::tests::entity_debug",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::test_event_cursor_clear",
"event::tests::test_event_cursor_len_update",
"entity::map_entities::tests::world_scope_reserves_generations",
"identifier::masks::tests::pack_kind_bits",
"change_detection::tests::change_expiration",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"observer::tests::observer_entity_routing",
"event::tests::test_events_update_drain",
"event::tests::test_event_reader_iter_last",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_events",
"identifier::masks::tests::extract_high_value",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_clear_and_read",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_kind",
"event::tests::test_events_send_default",
"event::tests::test_events_extend_impl",
"observer::tests::observer_no_target",
"entity::map_entities::tests::dyn_entity_mapper_object_safe",
"intern::tests::static_sub_strings",
"intern::tests::same_interned_content",
"observer::tests::observer_order_replace",
"label::tests::dyn_eq_object_safe",
"observer::tests::observer_propagating",
"intern::tests::zero_sized_type",
"observer::tests::observer_propagating_join",
"intern::tests::fieldless_enum",
"observer::tests::observer_order_insert_remove",
"observer::tests::observer_multiple_components",
"intern::tests::same_interned_instance",
"observer::tests::observer_multiple_matches",
"observer::tests::observer_order_insert_remove_sparse",
"label::tests::dyn_hash_object_safe",
"identifier::tests::from_bits",
"observer::tests::observer_order_recursive",
"observer::tests::observer_despawn_archetype_flags",
"observer::tests::observer_multiple_events",
"identifier::tests::id_construction",
"identifier::tests::id_comparison",
"observer::tests::observer_dynamic_trigger",
"observer::tests::observer_propagating_halt",
"observer::tests::observer_order_spawn_despawn",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"query::access::tests::access_get_conflicts",
"query::access::tests::test_access_filters_clone",
"query::access::tests::filtered_access_extend",
"query::access::tests::test_access_filters_clone_from",
"query::access::tests::filtered_combined_access",
"observer::tests::observer_propagating_world",
"observer::tests::observer_trigger_ref",
"observer::tests::observer_despawn",
"query::access::tests::filtered_access_extend_or",
"identifier::masks::tests::pack_into_u64",
"intern::tests::different_interned_content",
"query::access::tests::read_all_access_conflicts",
"query::access::tests::test_access_clone",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"observer::tests::observer_trigger_targets_ref",
"observer::tests::observer_propagating_world_skipping",
"observer::tests::observer_propagating_no_next",
"observer::tests::observer_propagating_parallel_propagation",
"observer::tests::observer_dynamic_component",
"query::access::tests::test_access_clone_from",
"query::access::tests::test_filtered_access_clone",
"query::access::tests::test_filtered_access_clone_from",
"query::access::tests::test_filtered_access_set_from",
"query::builder::tests::builder_dynamic_components",
"query::builder::tests::builder_or",
"query::builder::tests::builder_with_without_dynamic",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"event::tests::ensure_reader_readonly",
"observer::tests::observer_multiple_listeners",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"query::fetch::tests::world_query_struct_variants",
"query::fetch::tests::read_only_field_visibility",
"query::builder::tests::builder_static_components",
"query::iter::tests::query_sort_after_next - should panic",
"query::builder::tests::builder_transmute",
"query::access::tests::test_filtered_access_set_clone",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::state::tests::can_transmute_changed",
"query::fetch::tests::world_query_phantom_data",
"query::fetch::tests::world_query_metadata_collision",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::state::tests::can_transmute_added",
"query::state::tests::can_transmute_mut_fetch",
"query::iter::tests::query_sorts",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::can_generalize_with_option",
"query::builder::tests::builder_static_dense_dynamic_sparse",
"query::builder::tests::builder_with_without_static",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::join_with_get",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::tests::any_query",
"query::state::tests::transmute_from_sparse_to_dense",
"query::state::tests::transmute_from_dense_to_sparse",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"query::tests::many_entities",
"query::tests::has_query",
"query::state::tests::join",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::insert_reflect_bundle",
"query::tests::query",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"reflect::entity_commands::tests::remove_reflected_bundle_with_registry",
"query::tests::query_iter_combinations",
"event::tests::test_event_reader_iter_nth",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"event::tests::test_event_mutator_iter_nth",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"schedule::condition::tests::distributive_run_if_compiles",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::schedule::tests::configure_set_on_new_schedule",
"query::state::tests::right_world_get_many - should panic",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"query::tests::derived_worldqueries",
"event::tests::test_event_cursor_par_read",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::executor::tests::invalid_condition_param_skips_system",
"query::state::tests::transmute_with_different_world - should panic",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"query::tests::multi_storage_query",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::tests::query_iter_combinations_sparse",
"schedule::set::tests::test_derive_schedule_label",
"schedule::stepping::tests::continue_never_run",
"schedule::schedule::tests::inserts_a_sync_point",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"schedule::set::tests::test_derive_system_set",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::schedule::tests::no_sync_chain::chain_all",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::clear_system",
"query::tests::self_conflicting_worldquery - should panic",
"schedule::stepping::tests::step_always_run",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::stepping::tests::step_never_run",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::set::tests::test_schedule_label",
"schedule::stepping::tests::stepping_disabled",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::stepping::tests::remove_schedule",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::stepping::tests::unknown_schedule",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::stepping::tests::continue_always_run",
"schedule::executor::multi_threaded::tests::check_spawn_exclusive_system_task_miri",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::tests::conditions::system_with_condition",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::stepping::tests::verify_cursor",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::stepping::tests::waiting_always_run",
"schedule::stepping::tests::disabled_never_run",
"reflect::entity_commands::tests::remove_reflected_bundle",
"schedule::executor::tests::invalid_system_param_skips",
"schedule::stepping::tests::clear_schedule",
"reflect::entity_commands::tests::remove_reflected",
"schedule::stepping::tests::step_breakpoint",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"reflect::entity_commands::tests::insert_reflect_bundle_with_registry",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::disabled_always_run",
"event::tests::test_event_cursor_par_read_mut",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::stepping::tests::step_run_if_false",
"schedule::stepping::tests::clear_breakpoint",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"schedule::schedule::tests::merges_sync_points_into_one",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"schedule::schedule::tests::no_sync_chain::chain_first",
"query::tests::par_iter_mut_change_detection",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"schedule::tests::stepping::multi_threaded_executor",
"schedule::tests::system_ambiguity::correct_ambiguities",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::events",
"schedule::tests::system_ambiguity::components",
"query::tests::query_filtered_iter_combinations",
"schedule::condition::tests::run_condition",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::condition::tests::multiple_run_conditions",
"schedule::tests::stepping::simple_executor",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::system_execution::run_system",
"schedule::tests::system_ambiguity::read_component_and_entity_mut",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"schedule::tests::system_ambiguity::read_only",
"schedule::tests::system_ambiguity::read_world",
"schedule::tests::system_ambiguity::write_component_and_entity_ref",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::system_ambiguity::resource_mut_and_entity_ref",
"schedule::tests::system_ambiguity::resource_and_entity_mut",
"schedule::tests::system_ambiguity::shared_resource_mut_component",
"schedule::tests::system_ambiguity::exclusive",
"system::builder::tests::multi_param_builder",
"system::builder::tests::custom_param_builder",
"system::builder::tests::param_set_builder",
"system::builder::tests::query_builder_state",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"system::commands::tests::entity_commands_entry",
"storage::blob_vec::tests::resize_test",
"storage::blob_vec::tests::blob_vec",
"storage::sparse_set::tests::sparse_set",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_array::tests::make_sure_zst_components_get_dropped - should panic",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::builder::tests::dyn_builder",
"system::commands::tests::test_commands_are_send_and_sync",
"system::system::tests::run_system_once",
"system::system::tests::run_two_systems",
"system::builder::tests::param_set_vec_builder",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"system::system_name::tests::test_system_name_exclusive_param",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::builder::tests::vec_builder",
"storage::sparse_set::tests::sparse_sets",
"system::system_name::tests::test_system_name_regular_param",
"system::system::tests::non_send_resources",
"system::builder::tests::query_builder",
"system::system_param::tests::system_param_const_generics",
"storage::table::tests::table",
"system::builder::tests::local_builder",
"system::system_param::tests::system_param_field_limit",
"system::function_system::tests::into_system_type_id_consistency",
"system::system_name::tests::test_closure_system_name_regular_param",
"system::commands::tests::remove_resources",
"system::system_param::tests::system_param_flexibility",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"system::commands::tests::insert_components",
"system::system_param::tests::param_set_non_send_second",
"system::builder::tests::multi_param_builder_inference",
"system::system::tests::command_processing",
"system::commands::tests::remove_components",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"system::system_param::tests::system_param_generic_bounds",
"system::commands::tests::commands",
"system::commands::tests::append",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::non_sync_local",
"system::commands::tests::remove_components_by_id",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::system_param::tests::param_set_non_send_first",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_where_clause",
"system::system_registry::tests::exclusive_system",
"system::system_registry::tests::change_detection",
"system::system_registry::tests::cached_system",
"system::system_param::tests::system_param_struct_variants",
"system::system_registry::tests::local_variables",
"system::tests::assert_entity_mut_system_does_conflict - should panic",
"schedule::condition::tests::run_condition_combinators",
"system::tests::any_of_with_ref_and_mut - should panic",
"schedule::tests::system_ordering::order_systems",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::any_of_with_mut_and_ref - should panic",
"system::tests::any_of_working",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::system_with_input_ref",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::assert_systems",
"system::tests::assert_entity_ref_and_entity_mut_system_does_conflict - should panic",
"system::tests::long_life_test",
"system::tests::immutable_mut_test",
"system::system_registry::tests::system_with_input_mut",
"system::tests::non_send_option_system",
"system::system_registry::tests::nested_systems_with_inputs",
"system::tests::commands_param_set",
"system::tests::into_iter_impl",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::convert_mut_to_immut",
"system::tests::disjoint_query_mut_system",
"system::tests::get_system_conflicts",
"system::tests::local_system",
"system::tests::non_send_system",
"system::tests::any_of_with_and_without_common",
"system::tests::changed_resource_system",
"system::system_param::tests::system_param_private_fields",
"system::tests::any_of_and_without",
"system::tests::any_of_with_empty_and_mut",
"system::system_registry::tests::output_values",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::system_registry::tests::input_values",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::any_of_with_entity_and_mut",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::nonconflicting_system_resources",
"system::tests::read_system_state",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::panic_inside_system - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::query_is_empty",
"system::tests::query_validates_world_id - should panic",
"system::tests::pipe_change_detection",
"system::tests::system_state_change_detection",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_archetype_update",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::simple_system",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::query_set_system",
"query::tests::query_filtered_exactsizeiterator_len",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::or_param_set_system",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::assert_world_and_entity_mut_system_does_conflict - should panic",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_with_and_without_common",
"system::tests::conflicting_system_resources - should panic",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_has_filter_with",
"system::tests::get_many_is_ordered",
"system::tests::test_combinator_clone",
"system::tests::update_archetype_component_access_works",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"tests::add_remove_components",
"tests::despawn_mixed_storage",
"tests::clear_entities",
"tests::insert_or_spawn_batch",
"system::tests::world_collections_system",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::filtered_query_access",
"tests::multiple_worlds_same_query_get - should panic",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::entity_ref_and_entity_ref_query_no_panic",
"tests::dynamic_required_components",
"tests::generic_required_components",
"tests::empty_spawn",
"tests::insert_overwrite_drop",
"tests::entity_mut_and_entity_mut_query_panic - should panic",
"tests::insert_or_spawn_batch_invalid",
"tests::mut_and_ref_query_panic - should panic",
"tests::insert_overwrite_drop_sparse",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::non_send_resource_points_to_distinct_data",
"tests::non_send_resource",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::changed_trackers_sparse",
"tests::mut_and_mut_query_panic - should panic",
"tests::non_send_resource_panic - should panic",
"system::tests::removal_tracking",
"tests::changed_trackers",
"schedule::tests::system_execution::parallel_execution",
"tests::par_for_each_dense",
"tests::added_tracking",
"tests::par_for_each_sparse",
"tests::duplicate_components_panic - should panic",
"tests::added_queries",
"system::tests::write_system_state",
"tests::bundle_derive",
"tests::despawn_table_storage",
"tests::entity_ref_and_entity_mut_query_panic - should panic",
"tests::changed_query",
"tests::exact_size_query",
"tests::query_filter_with",
"tests::query_all",
"tests::query_missing_component",
"tests::query_get",
"tests::query_filter_with_sparse",
"tests::query_filter_with_for_each",
"tests::query_filter_without",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_sparse",
"tests::query_filters_dont_collide_with_fetches",
"tests::remove",
"tests::query_optional_component_sparse_no_match",
"tests::remove_tracking",
"tests::required_components_take_leaves_required",
"tests::required_components_spawn_then_insert_no_overwrite",
"tests::required_components",
"tests::remove_missing",
"tests::required_components_insert_existing_hooks",
"tests::required_components_retain_keeps_required",
"tests::ref_and_mut_query_panic - should panic",
"tests::query_single_component_for_each",
"tests::query_single_component",
"tests::random_access",
"tests::query_sparse_component",
"tests::reserve_and_spawn",
"tests::resource",
"tests::query_optional_component_table",
"tests::reserve_entities_across_worlds",
"tests::spawn_batch",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"tests::resource_scope",
"tests::take",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::entity_mut_except_conflicts_with_self - should panic",
"tests::query_filter_with_sparse_for_each",
"tests::required_components_spawn_nonexistent_hooks",
"tests::query_all_for_each",
"tests::test_is_archetypal_size_hints",
"world::command_queue::test::test_command_queue_inner",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_is_send",
"world::entity_ref::tests::entity_mut_except",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"tests::stateful_query_handles_new_archetype",
"world::entity_ref::tests::entity_mut_except_conflicts_with_other - should panic",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::entity_mut_except_doesnt_conflict",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::get_components",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::entity_ref_except",
"world::entity_ref::tests::entity_ref_except_doesnt_conflict",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_ref_except_conflicts_with_other - should panic",
"world::entity_ref::tests::entity_ref_except_conflicts_with_self - should panic",
"tests::sparse_set_add_remove_many",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::tests::custom_resource_with_layout",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::reflect::tests::get_component_as_mut_reflect",
"world::reflect::tests::get_component_as_reflect",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::identifier::tests::world_id_system_param",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::tests::get_resource_mut_by_id",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iter_resources_mut",
"world::tests::iterate_entities_mut",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::identifier::tests::world_id_exclusive_system_param",
"world::tests::panic_while_overwriting_component",
"world::tests::inspect_entity_components",
"world::tests::spawn_empty_bundle",
"world::tests::test_verify_unique_entities",
"world::tests::iter_resources",
"world::tests::iterate_entities",
"world::tests::get_resource_by_id",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1028) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1036) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 1237) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 305) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 240) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 108) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 250) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1253)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 100)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/lib.rs - (line 238)",
"crates/bevy_ecs/src/component.rs - component::Component (line 315)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/component.rs - component::Component (line 43)",
"crates/bevy_ecs/src/lib.rs - (line 286)",
"crates/bevy_ecs/src/lib.rs - (line 213)",
"crates/bevy_ecs/src/component.rs - component::Component (line 89)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 199)",
"crates/bevy_ecs/src/observer/mod.rs - observer::Trigger<'w,E,B>::observer (line 70)",
"crates/bevy_ecs/src/component.rs - component::Component (line 245)",
"crates/bevy_ecs/src/component.rs - component::Component (line 280)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 38)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1499)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 355)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1513)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 91)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 789)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper::mappings (line 88)",
"crates/bevy_ecs/src/lib.rs - (line 166)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 60)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 38)",
"crates/bevy_ecs/src/lib.rs - (line 190)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 574)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 722)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining (line 63)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 124)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 215) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 237) - compile fail",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 224)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 267) - compile fail",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining_mut (line 100)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 413) - compile fail",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 432) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 380) - compile fail",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 27)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 36)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 185) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 25)",
"crates/bevy_ecs/src/label.rs - label::define_label (line 65)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 125)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 1009)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 89)",
"crates/bevy_ecs/src/component.rs - component::Component (line 171)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 229)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 123)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 960)",
"crates/bevy_ecs/src/lib.rs - (line 253)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 103)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 152)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 140)",
"crates/bevy_ecs/src/component.rs - component::Component (line 149)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 971)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 205)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 118)",
"crates/bevy_ecs/src/lib.rs - (line 335)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 105)",
"crates/bevy_ecs/src/lib.rs - (line 310)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 117)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 704)",
"crates/bevy_ecs/src/component.rs - component::Component (line 107)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 814)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 344)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 598)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 667)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 144)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 209)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 172)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 158)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1860)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 817)",
"crates/bevy_ecs/src/lib.rs - (line 125)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 254)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 66)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/component.rs - component::Component (line 197)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 392)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1883)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 556)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 10)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 237)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 209)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 221)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 128)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 67)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 271) - compile fail",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 841)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 190)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 102)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 83)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 769)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 246)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 648)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 623)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 153)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 59)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 336)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 35)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 585)",
"crates/bevy_ecs/src/component.rs - component::Component (line 127)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed (line 1082)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 134)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1417)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 770)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 546)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 812)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed_to (line 1133)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 898)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 994)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 911) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1041)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 394)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 556)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 518)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1022) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 289)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 676)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 648)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 950)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::reborrow (line 416)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 1001)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 19)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 716)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 231)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 831)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 666)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 14)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::queue (line 1411)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 250)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemParamBuilder (line 18)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 245)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 556) - compile fail",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 737)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::entry (line 963)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::queue (line 539)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 497)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 48)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1861) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 621)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert_if (line 1056)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 508)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 143)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 567)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert_if_new_and (line 1278)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1837)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 46)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::despawn (line 1387)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 455)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 344)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 402)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_system (line 737)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::retain (line 1435)",
"crates/bevy_ecs/src/system/input.rs - system::input::InRef (line 106)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 176)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 238)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::remove (line 1327)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert (line 1183)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert_if (line 1231)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1131)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 289)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1527)",
"crates/bevy_ecs/src/system/input.rs - system::input::InMut (line 157)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 933)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 68)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 279)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 146)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1570)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1284)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 964)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1208)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 485)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/input.rs - system::input::In (line 54)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 186)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1249)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 589)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 843)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 229)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 261)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 129) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 854)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 274)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1103)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 878)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 50)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 447)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 643)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 223)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 439)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 806)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1178)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 273)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 375)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 27)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 404)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 1009)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1415)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 131)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1327)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 294)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 294)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 80)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::DynSystemParam (line 1980)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 901)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 206)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1163)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 804)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 527)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 472)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 746)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 375)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 315)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 247)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1057)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 2602)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 611)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 468)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 423)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 541)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 414)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2525)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 576)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1193)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1025)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1814)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1979)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 341)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 698)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 835)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1110)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 926)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 893)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 2503)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1078)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 31)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1260)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2865)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 2280)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 457)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1229)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 12,867
|
bevyengine__bevy-12867
|
[
"12837"
] |
fae2200b1ad1df3ec97b6d3545022e8e5581e245
|
diff --git a/crates/bevy_math/src/primitives/dim3.rs b/crates/bevy_math/src/primitives/dim3.rs
--- a/crates/bevy_math/src/primitives/dim3.rs
+++ b/crates/bevy_math/src/primitives/dim3.rs
@@ -834,14 +834,14 @@ impl Primitive3d for Tetrahedron {}
impl Default for Tetrahedron {
/// Returns the default [`Tetrahedron`] with the vertices
- /// `[0.0, 0.5, 0.0]`, `[-0.5, -0.5, 0.0]`, `[0.5, -0.5, 0.0]` and `[0.0, 0.0, 0.5]`.
+ /// `[0.5, 0.5, 0.5]`, `[-0.5, 0.5, -0.5]`, `[-0.5, -0.5, 0.5]` and `[0.5, -0.5, -0.5]`.
fn default() -> Self {
Self {
vertices: [
- Vec3::new(0.0, 0.5, 0.0),
- Vec3::new(-0.5, -0.5, 0.0),
- Vec3::new(0.5, -0.5, 0.0),
- Vec3::new(0.0, 0.0, 0.5),
+ Vec3::new(0.5, 0.5, 0.5),
+ Vec3::new(-0.5, 0.5, -0.5),
+ Vec3::new(-0.5, -0.5, 0.5),
+ Vec3::new(0.5, -0.5, -0.5),
],
}
}
|
diff --git a/crates/bevy_math/src/primitives/dim3.rs b/crates/bevy_math/src/primitives/dim3.rs
--- a/crates/bevy_math/src/primitives/dim3.rs
+++ b/crates/bevy_math/src/primitives/dim3.rs
@@ -1085,20 +1085,17 @@ mod tests {
);
assert_relative_eq!(tetrahedron.centroid(), Vec3::new(-0.225, -0.375, 1.55));
- assert_eq!(Tetrahedron::default().area(), 1.4659258, "incorrect area");
+ assert_eq!(Tetrahedron::default().area(), 3.4641016, "incorrect area");
assert_eq!(
Tetrahedron::default().volume(),
- 0.083333336,
+ 0.33333334,
"incorrect volume"
);
assert_eq!(
Tetrahedron::default().signed_volume(),
- 0.083333336,
+ -0.33333334,
"incorrect signed volume"
);
- assert_relative_eq!(
- Tetrahedron::default().centroid(),
- Vec3::new(0.0, -0.125, 0.125)
- );
+ assert_relative_eq!(Tetrahedron::default().centroid(), Vec3::ZERO);
}
}
|
Default tetrahedron origin should be at (0, 0, 0)
I think the default tet should be centered on the origin. It's going to rotate strangely when people mesh it and apply transforms. I believe all other default primitives have their center of mass more or less at the origin.
_Originally posted by @NthTensor in https://github.com/bevyengine/bevy/pull/12688#pullrequestreview-1971768933_
|
2024-04-03T22:04:48Z
|
1.77
|
2024-04-03T23:15:04Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"primitives::dim3::tests::tetrahedron_math"
] |
[
"bounding::bounded2d::aabb2d_tests::area",
"bounding::bounded2d::aabb2d_tests::closest_point",
"bounding::bounded2d::aabb2d_tests::center",
"bounding::bounded2d::aabb2d_tests::contains",
"bounding::bounded2d::aabb2d_tests::grow",
"bounding::bounded2d::aabb2d_tests::half_size",
"bounding::bounded2d::aabb2d_tests::intersect_aabb",
"bounding::bounded2d::aabb2d_tests::intersect_bounding_circle",
"bounding::bounded2d::aabb2d_tests::merge",
"bounding::bounded2d::aabb2d_tests::scale_around_center",
"bounding::bounded2d::aabb2d_tests::shrink",
"bounding::bounded2d::aabb2d_tests::transform",
"bounding::bounded2d::bounding_circle_tests::area",
"bounding::bounded2d::bounding_circle_tests::closest_point",
"bounding::bounded2d::bounding_circle_tests::contains",
"bounding::bounded2d::bounding_circle_tests::contains_identical",
"bounding::bounded2d::bounding_circle_tests::grow",
"bounding::bounded2d::bounding_circle_tests::intersect_bounding_circle",
"bounding::bounded2d::bounding_circle_tests::merge",
"bounding::bounded2d::bounding_circle_tests::merge_identical",
"bounding::bounded2d::bounding_circle_tests::scale_around_center",
"bounding::bounded2d::bounding_circle_tests::shrink",
"bounding::bounded2d::bounding_circle_tests::transform",
"bounding::bounded2d::primitive_impls::tests::acute_triangle",
"bounding::bounded2d::primitive_impls::tests::capsule",
"bounding::bounded2d::primitive_impls::tests::circle",
"bounding::bounded2d::primitive_impls::tests::ellipse",
"bounding::bounded2d::primitive_impls::tests::line",
"bounding::bounded2d::primitive_impls::tests::obtuse_triangle",
"bounding::bounded2d::primitive_impls::tests::plane",
"bounding::bounded2d::primitive_impls::tests::polygon",
"bounding::bounded2d::primitive_impls::tests::polyline",
"bounding::bounded2d::primitive_impls::tests::rectangle",
"bounding::bounded2d::primitive_impls::tests::regular_polygon",
"bounding::bounded2d::primitive_impls::tests::segment",
"bounding::bounded3d::aabb3d_tests::area",
"bounding::bounded3d::aabb3d_tests::center",
"bounding::bounded3d::aabb3d_tests::closest_point",
"bounding::bounded3d::aabb3d_tests::contains",
"bounding::bounded3d::aabb3d_tests::grow",
"bounding::bounded3d::aabb3d_tests::half_size",
"bounding::bounded3d::aabb3d_tests::intersect_aabb",
"bounding::bounded3d::aabb3d_tests::intersect_bounding_sphere",
"bounding::bounded3d::aabb3d_tests::merge",
"bounding::bounded3d::aabb3d_tests::scale_around_center",
"bounding::bounded3d::aabb3d_tests::shrink",
"bounding::bounded3d::aabb3d_tests::transform",
"bounding::bounded3d::bounding_sphere_tests::area",
"bounding::bounded3d::bounding_sphere_tests::closest_point",
"bounding::bounded3d::bounding_sphere_tests::contains",
"bounding::bounded3d::bounding_sphere_tests::contains_identical",
"bounding::bounded3d::bounding_sphere_tests::grow",
"bounding::bounded3d::bounding_sphere_tests::intersect_bounding_sphere",
"bounding::bounded3d::bounding_sphere_tests::merge",
"bounding::bounded3d::bounding_sphere_tests::merge_identical",
"bounding::bounded3d::bounding_sphere_tests::scale_around_center",
"bounding::bounded3d::bounding_sphere_tests::shrink",
"bounding::bounded3d::bounding_sphere_tests::transform",
"bounding::bounded3d::primitive_impls::tests::capsule",
"bounding::bounded3d::primitive_impls::tests::cone",
"bounding::bounded3d::primitive_impls::tests::conical_frustum",
"bounding::bounded3d::primitive_impls::tests::cuboid",
"bounding::bounded3d::primitive_impls::tests::cylinder",
"bounding::bounded3d::primitive_impls::tests::line",
"bounding::bounded3d::primitive_impls::tests::plane",
"bounding::bounded3d::primitive_impls::tests::polyline",
"bounding::bounded3d::primitive_impls::tests::segment",
"bounding::bounded3d::primitive_impls::tests::sphere",
"bounding::bounded3d::primitive_impls::tests::torus",
"bounding::bounded3d::primitive_impls::tests::wide_conical_frustum",
"bounding::raycast2d::tests::test_aabb_cast_hits",
"bounding::raycast2d::tests::test_circle_cast_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_inside",
"bounding::raycast2d::tests::test_ray_intersection_aabb_misses",
"bounding::raycast2d::tests::test_ray_intersection_circle_hits",
"bounding::raycast2d::tests::test_ray_intersection_circle_inside",
"bounding::raycast2d::tests::test_ray_intersection_circle_misses",
"bounding::raycast3d::tests::test_ray_intersection_aabb_hits",
"bounding::raycast3d::tests::test_aabb_cast_hits",
"bounding::raycast3d::tests::test_ray_intersection_aabb_misses",
"bounding::raycast3d::tests::test_ray_intersection_aabb_inside",
"bounding::raycast3d::tests::test_ray_intersection_sphere_hits",
"bounding::raycast3d::tests::test_ray_intersection_sphere_misses",
"bounding::raycast3d::tests::test_ray_intersection_sphere_inside",
"bounding::raycast3d::tests::test_sphere_cast_hits",
"cubic_splines::tests::cardinal_control_pts",
"cubic_splines::tests::cubic_to_rational",
"cubic_splines::tests::easing_overshoot",
"cubic_splines::tests::cubic",
"cubic_splines::tests::easing_simple",
"cubic_splines::tests::nurbs_circular_arc",
"cubic_splines::tests::easing_undershoot",
"direction::tests::dir2_creation",
"direction::tests::dir3_creation",
"direction::tests::dir3a_creation",
"float_ord::tests::float_ord_cmp",
"float_ord::tests::float_ord_cmp_operators",
"float_ord::tests::float_ord_eq",
"float_ord::tests::float_ord_hash",
"primitives::dim2::tests::annulus_closest_point",
"primitives::dim2::tests::annulus_math",
"primitives::dim2::tests::circle_closest_point",
"primitives::dim2::tests::circle_math",
"primitives::dim2::tests::ellipse_math",
"primitives::dim2::tests::rectangle_closest_point",
"primitives::dim2::tests::rectangle_math",
"primitives::dim2::tests::regular_polygon_math",
"primitives::dim2::tests::regular_polygon_vertices",
"primitives::dim2::tests::triangle_circumcenter",
"primitives::dim2::tests::triangle_math",
"primitives::dim2::tests::triangle_winding_order",
"primitives::dim3::tests::capsule_math",
"primitives::dim3::tests::cone_math",
"primitives::dim3::tests::cuboid_closest_point",
"primitives::dim3::tests::cuboid_math",
"primitives::dim3::tests::cylinder_math",
"primitives::dim3::tests::direction_creation",
"primitives::dim3::tests::plane_from_points",
"primitives::dim3::tests::sphere_closest_point",
"primitives::dim3::tests::sphere_math",
"primitives::dim3::tests::torus_math",
"ray::tests::intersect_plane_2d",
"ray::tests::intersect_plane_3d",
"rects::irect::tests::rect_inset",
"rects::irect::tests::rect_intersect",
"rects::irect::tests::rect_union",
"rects::irect::tests::rect_union_pt",
"rects::irect::tests::well_formed",
"rects::rect::tests::rect_inset",
"rects::rect::tests::rect_intersect",
"rects::rect::tests::rect_union",
"rects::rect::tests::rect_union_pt",
"rects::rect::tests::well_formed",
"rects::urect::tests::rect_inset",
"rects::urect::tests::rect_intersect",
"rects::urect::tests::rect_union",
"rects::urect::tests::rect_union_pt",
"rects::urect::tests::well_formed",
"rotation2d::tests::add",
"rotation2d::tests::creation",
"rotation2d::tests::is_near_identity",
"rotation2d::tests::length",
"rotation2d::tests::nlerp",
"rotation2d::tests::normalize",
"rotation2d::tests::rotate",
"rotation2d::tests::slerp",
"rotation2d::tests::subtract",
"rotation2d::tests::try_normalize",
"shape_sampling::tests::circle_boundary_sampling",
"shape_sampling::tests::circle_interior_sampling",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_corners (line 46)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::new (line 29)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::height (line 144)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::is_empty (line 116)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::contains (line 208)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::new (line 29)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_corners (line 46)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::height (line 140)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_corners (line 46)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::contains (line 196)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::width (line 130)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_center_size (line 69)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_center_half_size (line 90)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::size (line 154)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::height (line 141)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::inset (line 300)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::intersect (line 260)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::half_size (line 176)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::union_point (line 237)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::width (line 126)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::is_empty (line 112)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_center_size (line 73)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_center_size (line 73)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::contains (line 205)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::center (line 194)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::inset (line 288)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_center_half_size (line 94)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::is_empty (line 113)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::new (line 29)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::inset (line 297)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::union (line 223)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::half_size (line 168)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicCardinalSpline (line 169)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicHermite (line 97)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::intersect (line 272)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::width (line 127)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::union (line 214)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::center (line 191)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::size (line 155)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::half_size (line 173)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_center_half_size (line 94)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::normalize (line 317)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::union_point (line 249)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::center (line 182)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicBezier (line 32)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicSegment<Vec2>::ease (line 701)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::union_point (line 246)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rotation2d (line 11)",
"crates/bevy_math/src/shape_sampling.rs - shape_sampling::ShapeSample::sample_interior (line 19)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicBSpline (line 256)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::intersect (line 269)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::size (line 158)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rotation2d::nlerp (line 290)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rotation2d::slerp (line 328)",
"crates/bevy_math/src/shape_sampling.rs - shape_sampling::ShapeSample::sample_boundary (line 33)",
"crates/bevy_math/src/cubic_splines.rs - cubic_splines::CubicNurbs (line 369)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::union (line 226)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 12,842
|
bevyengine__bevy-12842
|
[
"9261"
] |
8092e2c86d32a0f83c7c7d97233130d6d7f68dc4
|
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -4,6 +4,7 @@ use super::{Deferred, IntoSystem, RegisterSystem, Resource};
use crate::{
self as bevy_ecs,
bundle::Bundle,
+ component::ComponentId,
entity::{Entities, Entity},
system::{RunSystemWithInput, SystemId},
world::{Command, CommandQueue, EntityWorldMut, FromWorld, World},
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -893,6 +894,11 @@ impl EntityCommands<'_> {
self.add(remove::<T>)
}
+ /// Removes a component from the entity.
+ pub fn remove_by_id(&mut self, component_id: ComponentId) -> &mut Self {
+ self.add(remove_by_id(component_id))
+ }
+
/// Despawns the entity.
///
/// See [`World::despawn`] for more details.
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -1102,8 +1108,20 @@ fn try_insert(bundle: impl Bundle) -> impl EntityCommand {
/// For a [`Bundle`] type `T`, this will remove any components in the bundle.
/// Any components in the bundle that aren't found on the entity will be ignored.
fn remove<T: Bundle>(entity: Entity, world: &mut World) {
- if let Some(mut entity_mut) = world.get_entity_mut(entity) {
- entity_mut.remove::<T>();
+ if let Some(mut entity) = world.get_entity_mut(entity) {
+ entity.remove::<T>();
+ }
+}
+
+/// An [`EntityCommand`] that removes components with a provided [`ComponentId`] from an entity.
+/// # Panics
+///
+/// Panics if the provided [`ComponentId`] does not exist in the [`World`].
+fn remove_by_id(component_id: ComponentId) -> impl EntityCommand {
+ move |entity: Entity, world: &mut World| {
+ if let Some(mut entity) = world.get_entity_mut(entity) {
+ entity.remove_by_id(component_id);
+ }
}
}
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -1151,6 +1151,27 @@ impl<'w> EntityWorldMut<'w> {
self
}
+ /// Removes a dynamic [`Component`] from the entity if it exists.
+ ///
+ /// You should prefer to use the typed API [`EntityWorldMut::remove`] where possible.
+ ///
+ /// # Panics
+ ///
+ /// Panics if the provided [`ComponentId`] does not exist in the [`World`].
+ pub fn remove_by_id(&mut self, component_id: ComponentId) -> &mut Self {
+ let components = &mut self.world.components;
+
+ let bundle_id = self
+ .world
+ .bundles
+ .init_component_info(components, component_id);
+
+ // SAFETY: the `BundleInfo` for this `component_id` is initialized above
+ self.location = unsafe { self.remove_bundle(bundle_id) };
+
+ self
+ }
+
/// Despawns the current entity.
///
/// See [`World::despawn`] for more details.
|
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -1153,9 +1171,12 @@ mod tests {
system::{Commands, Resource},
world::{CommandQueue, World},
};
- use std::sync::{
- atomic::{AtomicUsize, Ordering},
- Arc,
+ use std::{
+ any::TypeId,
+ sync::{
+ atomic::{AtomicUsize, Ordering},
+ Arc,
+ },
};
#[allow(dead_code)]
diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs
--- a/crates/bevy_ecs/src/system/commands/mod.rs
+++ b/crates/bevy_ecs/src/system/commands/mod.rs
@@ -1282,6 +1303,59 @@ mod tests {
assert_eq!(results_after_u64, vec![]);
}
+ #[test]
+ fn remove_components_by_id() {
+ let mut world = World::default();
+
+ let mut command_queue = CommandQueue::default();
+ let (dense_dropck, dense_is_dropped) = DropCk::new_pair();
+ let (sparse_dropck, sparse_is_dropped) = DropCk::new_pair();
+ let sparse_dropck = SparseDropCk(sparse_dropck);
+
+ let entity = Commands::new(&mut command_queue, &world)
+ .spawn((W(1u32), W(2u64), dense_dropck, sparse_dropck))
+ .id();
+ command_queue.apply(&mut world);
+ let results_before = world
+ .query::<(&W<u32>, &W<u64>)>()
+ .iter(&world)
+ .map(|(a, b)| (a.0, b.0))
+ .collect::<Vec<_>>();
+ assert_eq!(results_before, vec![(1u32, 2u64)]);
+
+ // test component removal
+ Commands::new(&mut command_queue, &world)
+ .entity(entity)
+ .remove_by_id(world.components().get_id(TypeId::of::<W<u32>>()).unwrap())
+ .remove_by_id(world.components().get_id(TypeId::of::<W<u64>>()).unwrap())
+ .remove_by_id(world.components().get_id(TypeId::of::<DropCk>()).unwrap())
+ .remove_by_id(
+ world
+ .components()
+ .get_id(TypeId::of::<SparseDropCk>())
+ .unwrap(),
+ );
+
+ assert_eq!(dense_is_dropped.load(Ordering::Relaxed), 0);
+ assert_eq!(sparse_is_dropped.load(Ordering::Relaxed), 0);
+ command_queue.apply(&mut world);
+ assert_eq!(dense_is_dropped.load(Ordering::Relaxed), 1);
+ assert_eq!(sparse_is_dropped.load(Ordering::Relaxed), 1);
+
+ let results_after = world
+ .query::<(&W<u32>, &W<u64>)>()
+ .iter(&world)
+ .map(|(a, b)| (a.0, b.0))
+ .collect::<Vec<_>>();
+ assert_eq!(results_after, vec![]);
+ let results_after_u64 = world
+ .query::<&W<u64>>()
+ .iter(&world)
+ .map(|v| v.0)
+ .collect::<Vec<_>>();
+ assert_eq!(results_after_u64, vec![]);
+ }
+
#[test]
fn remove_resources() {
let mut world = World::default();
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -2767,6 +2788,22 @@ mod tests {
assert_eq!(dynamic_components, static_components);
}
+ #[test]
+ fn entity_mut_remove_by_id() {
+ let mut world = World::new();
+ let test_component_id = world.init_component::<TestComponent>();
+
+ let mut entity = world.spawn(TestComponent(42));
+ entity.remove_by_id(test_component_id);
+
+ let components: Vec<_> = world.query::<&TestComponent>().iter(&world).collect();
+
+ assert_eq!(components, vec![] as Vec<&TestComponent>);
+
+ // remove non-existent component does not panic
+ world.spawn_empty().remove_by_id(test_component_id);
+ }
+
#[derive(Component)]
struct A;
|
Missing `remove_by_id`
The untyped API seems to be missing the comparable `EntityMut::remove_by_id` or `EntityCommands::remove_by_id` methods. There are, however, `World::remove_resource_by_id` and `World::remove_non_send_by_id` for some reason.
|
i would like to solve this isssue in a decent way as my first contribution but i'm actually really new at bevy. So could someone verify my approach maybe.
I already defined a method called `EntitiyMut::remove_by_id(&mut self, component_id)` which takes a `component_id` and uses the instance of the world attribute to call the already existing method `World::remove_resource_by_id`. With that i can remove the wished component.

For `EntityCommands` (if its necessary) i don't have a solution right now.
@TimoCak There is no `insert_by_id` method on `EntityCommands` either, having `remove_by_id` on `EntityMut` would already be an improvement, don't hesitate to make a PR for it!
I don't think your implementation is right though. From what I understand your implementation is just removing a `Resource` from the `World`, instead of removing a `Component` from an `Entity`. I think you're supposed to do something similar to the implementation of the `remove` method, but instead of `for component_id in bundle_info.components().iter().cloned()` you have only one component_id.
I'd like to work on this and open a PR, if possible :)
I stumbled on these methods missing today as I would like to use them. Currently I consider to instead store `fn(&mut World, Entity)` commands instead to generate component removals at a place I don't have the type anymore. Is the PR by @mateuseap still wip?
|
2024-04-02T01:46:02Z
|
1.77
|
2024-04-03T10:04:59Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::mut_new",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::as_deref_mut",
"change_detection::tests::set_if_neq",
"bundle::tests::component_hook_order_spawn_despawn",
"change_detection::tests::change_tick_wraparound",
"bundle::tests::component_hook_order_insert_remove",
"change_detection::tests::change_tick_scan",
"entity::map_entities::tests::entity_mapper",
"change_detection::tests::change_expiration",
"bundle::tests::component_hook_order_recursive_multiple",
"bundle::tests::component_hook_order_recursive",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_comparison",
"entity::tests::entity_const",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_len_updated",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_firing_empty_event",
"event::tests::test_send_events_ids",
"event::tests::test_update_drain",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::from_bits",
"identifier::tests::id_comparison",
"identifier::tests::id_construction",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend",
"query::access::tests::filtered_combined_access",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::read_all_access_conflicts",
"query::builder::tests::builder_dynamic_components",
"query::builder::tests::builder_or",
"query::builder::tests::builder_static_components",
"query::builder::tests::builder_with_without_dynamic",
"query::builder::tests::builder_with_without_static",
"query::builder::tests::builder_transmute",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_metadata_collision",
"query::fetch::tests::world_query_phantom_data",
"query::state::tests::can_generalize_with_option",
"query::fetch::tests::world_query_struct_variants",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_transmute_added",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::tests::has_query",
"query::state::tests::join",
"query::state::tests::join_with_get",
"query::tests::any_query",
"query::tests::many_entities",
"query::tests::query_iter_combinations_sparse",
"query::tests::multi_storage_query",
"query::tests::query",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::tests::query_iter_combinations",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::tests::self_conflicting_worldquery - should panic",
"schedule::condition::tests::distributive_run_if_compiles",
"reflect::entity_commands::tests::insert_reflected",
"query::tests::derived_worldqueries",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"query::tests::query_filtered_iter_combinations",
"reflect::entity_commands::tests::remove_reflected",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::set::tests::test_derive_system_set",
"schedule::set::tests::test_derive_schedule_label",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::stepping::tests::waiting_always_run",
"schedule::stepping::tests::step_always_run",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::step_breakpoint",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::step_never_run",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::stepping::tests::unknown_schedule",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::stepping::tests::stepping_disabled",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::tests::system_ambiguity::events",
"schedule::stepping::tests::verify_cursor",
"schedule::tests::stepping::simple_executor",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"storage::blob_vec::tests::blob_vec",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"schedule::tests::stepping::multi_threaded_executor",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::read_world",
"schedule::tests::system_ambiguity::correct_ambiguities",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::tests::system_ambiguity::resources",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::schedule_build_errors::dependency_cycle",
"storage::table::tests::table",
"schedule::tests::system_execution::run_system",
"event::tests::test_event_iter_nth",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::schedule::tests::inserts_a_sync_point",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::tests::conditions::system_with_condition",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::set::tests::test_schedule_label",
"schedule::condition::tests::multiple_run_conditions",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"storage::sparse_set::tests::sparse_set",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"schedule::stepping::tests::step_run_if_false",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ordering::order_exclusive_systems",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::commands::tests::remove_resources",
"system::commands::tests::remove_components",
"system::system::tests::command_processing",
"system::system::tests::non_send_resources",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::condition::tests::run_condition_combinators",
"storage::blob_vec::tests::resize_test",
"storage::sparse_set::tests::sparse_sets",
"system::function_system::tests::into_system_type_id_consistency",
"system::system::tests::run_system_once",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"system::commands::tests::commands",
"system::commands::tests::append",
"system::system::tests::run_two_systems",
"schedule::condition::tests::run_condition",
"schedule::tests::system_ordering::add_systems_correct_order",
"system::system_param::tests::system_param_name_collision",
"system::system_name::tests::test_system_name_regular_param",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_struct_variants",
"system::system_param::tests::system_param_where_clause",
"system::system_name::tests::test_system_name_exclusive_param",
"schedule::schedule::tests::no_sync_chain::chain_second",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"schedule::tests::system_ambiguity::nonsend",
"system::system_registry::tests::exclusive_system",
"system::system_param::tests::system_param_const_generics",
"system::system_registry::tests::input_values",
"system::system_registry::tests::change_detection",
"system::system_param::tests::system_param_flexibility",
"system::system_param::tests::system_param_generic_bounds",
"system::system_registry::tests::local_variables",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::non_sync_local",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_registry::tests::nested_systems_with_inputs",
"system::system_registry::tests::nested_systems",
"system::system_param::tests::system_param_field_limit",
"schedule::schedule::tests::no_sync_chain::chain_all",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::system_param::tests::param_set_non_send_first",
"system::system_registry::tests::output_values",
"system::tests::assert_systems",
"schedule::tests::system_ambiguity::read_only",
"system::tests::assert_system_does_not_conflict - should panic",
"system::system_param::tests::param_set_non_send_second",
"system::tests::any_of_and_without",
"system::tests::any_of_has_no_filter_with - should panic",
"schedule::tests::system_ordering::order_systems",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"query::tests::par_iter_mut_change_detection",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::commands_param_set",
"system::tests::conflicting_system_resources - should panic",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::convert_mut_to_immut",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::get_system_conflicts",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::disjoint_query_mut_system",
"system::tests::long_life_test",
"system::tests::changed_resource_system",
"system::tests::immutable_mut_test",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::local_system",
"system::tests::into_iter_impl",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::non_send_system",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::non_send_option_system",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::nonconflicting_system_resources",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::pipe_change_detection",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::query_validates_world_id - should panic",
"system::tests::query_is_empty",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::simple_system",
"system::tests::read_system_state",
"system::tests::or_has_filter_with",
"system::tests::query_set_system",
"system::tests::system_state_change_detection",
"system::tests::system_state_archetype_update",
"system::tests::system_state_invalid_world - should panic",
"system::tests::or_param_set_system",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::update_archetype_component_access_works",
"system::tests::panic_inside_system - should panic",
"system::tests::write_system_state",
"tests::added_queries",
"tests::added_tracking",
"tests::changed_query",
"tests::add_remove_components",
"tests::bundle_derive",
"system::tests::world_collections_system",
"tests::despawn_mixed_storage",
"tests::clear_entities",
"tests::despawn_table_storage",
"system::tests::removal_tracking",
"tests::empty_spawn",
"tests::duplicate_components_panic - should panic",
"tests::changed_trackers_sparse",
"tests::changed_trackers",
"system::tests::test_combinator_clone",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::filtered_query_access",
"tests::exact_size_query",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop",
"tests::insert_or_spawn_batch_invalid",
"tests::insert_overwrite_drop_sparse",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource",
"tests::non_send_resource_drop_from_same_thread",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::non_send_resource_points_to_distinct_data",
"query::tests::query_filtered_exactsizeiterator_len",
"tests::non_send_resource_panic - should panic",
"tests::query_all_for_each",
"tests::query_all",
"tests::par_for_each_sparse",
"tests::par_for_each_dense",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::query_filter_with_sparse",
"tests::query_filter_with_sparse_for_each",
"tests::query_filter_without",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_get",
"tests::query_missing_component",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_sparse",
"tests::query_optional_component_sparse_no_match",
"tests::query_optional_component_table",
"tests::query_single_component_for_each",
"tests::query_single_component",
"tests::query_sparse_component",
"tests::random_access",
"tests::ref_and_mut_query_panic - should panic",
"tests::remove",
"tests::remove_missing",
"tests::reserve_and_spawn",
"tests::remove_tracking",
"tests::resource",
"tests::reserve_entities_across_worlds",
"tests::resource_scope",
"tests::sparse_set_add_remove_many",
"tests::stateful_query_handles_new_archetype",
"tests::spawn_batch",
"world::command_queue::test::test_command_is_send",
"world::command_queue::test::test_command_queue_inner",
"tests::take",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_id_exclusive_system_param",
"world::identifier::tests::world_id_system_param",
"world::identifier::tests::world_ids_unique",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_by_id",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iterate_entities_mut",
"world::tests::spawn_empty_bundle",
"world::tests::panic_while_overwriting_component",
"world::tests::iterate_entities",
"world::tests::inspect_entity_components",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 866) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 129) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 235) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 910) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 245) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 858) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 106) - compile fail",
"crates/bevy_ecs/src/component.rs - component::Component (line 85)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 166)",
"crates/bevy_ecs/src/component.rs - component::Component (line 104)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 34)",
"crates/bevy_ecs/src/lib.rs - (line 242)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 96)",
"crates/bevy_ecs/src/lib.rs - (line 168)",
"crates/bevy_ecs/src/lib.rs - (line 215)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 222)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 926)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 538)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 635)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 122)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 506)",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 447)",
"crates/bevy_ecs/src/component.rs - component::Component (line 139)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 197)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/lib.rs - (line 192)",
"crates/bevy_ecs/src/component.rs - component::Component (line 39)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 58)",
"crates/bevy_ecs/src/lib.rs - (line 290)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 461)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 83)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 101)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 744)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 31)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::NextState (line 146)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::States (line 33)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::State (line 78)",
"crates/bevy_ecs/src/event.rs - event::Events (line 118)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/event.rs - event::EventReader<'w,'s,E>::is_empty (line 449)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1543)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 109)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 142)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 483)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 800)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 329)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 652)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 923)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 100)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 120)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 217)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 287) - compile fail",
"crates/bevy_ecs/src/event.rs - event::ManualEventReader (line 573)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 9)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 690)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 259)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 252)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1520)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 723)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 375)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 176)",
"crates/bevy_ecs/src/lib.rs - (line 127)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 255)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 769)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 425)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::in_state (line 710)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 586)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 271)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 651)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 619)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 180)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 832)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/lib.rs - (line 257)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 294)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1000) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 101)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 890) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 65)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 526)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 214)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 349)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 138)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 488)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 382)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 404) - compile fail",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1308)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 562)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1435) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 188)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 190)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 540)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1411)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 415)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 610)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 41)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 876)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 332)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_changed (line 779)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 133)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 479)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 140)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 225)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_exists (line 665)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 147)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 55)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 559)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1108)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 417)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1185)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1226)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 942)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1512)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 114)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 616)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 254)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 579)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 112) - compile",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 327)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 785)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 187)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 693)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1261)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 292)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 455)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 670)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1080)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1155)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 174)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 45)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 219)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 252)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1304)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 822)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 187)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 75)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 263)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1555)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 258)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 170)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1395)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 211)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 916)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 254)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 299)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 273)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 24)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 375)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 535)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 799)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 654)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 372)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 333)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 415)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 232)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 1925)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 958)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 884)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 713)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1561)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 837)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 863)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 623)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 988)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 381)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2302)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 426)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 500)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1673)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1055)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1024)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 746)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 12,816
|
bevyengine__bevy-12816
|
[
"12184"
] |
a27ce270d00cdc54d4ecd2aae1d9edb6978ed0f7
|
diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs
--- a/crates/bevy_ui/src/layout/mod.rs
+++ b/crates/bevy_ui/src/layout/mod.rs
@@ -32,6 +32,12 @@ pub struct LayoutContext {
}
impl LayoutContext {
+ pub const DEFAULT: Self = Self {
+ scale_factor: 1.0,
+ physical_size: Vec2::ZERO,
+ min_size: 0.0,
+ max_size: 0.0,
+ };
/// create new a [`LayoutContext`] from the window's physical size and scale factor
fn new(scale_factor: f32, physical_size: Vec2) -> Self {
Self {
diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs
--- a/crates/bevy_ui/src/layout/mod.rs
+++ b/crates/bevy_ui/src/layout/mod.rs
@@ -43,6 +49,12 @@ impl LayoutContext {
}
}
+impl Default for LayoutContext {
+ fn default() -> Self {
+ Self::DEFAULT
+ }
+}
+
#[derive(Debug, Error)]
pub enum LayoutError {
#[error("Invalid hierarchy")]
diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs
--- a/crates/bevy_ui/src/layout/mod.rs
+++ b/crates/bevy_ui/src/layout/mod.rs
@@ -156,6 +168,8 @@ pub fn ui_layout_system(
);
ui_surface.upsert_node(entity, &style, &layout_context);
}
+ } else {
+ ui_surface.upsert_node(entity, &Style::default(), &LayoutContext::default());
}
}
scale_factor_events.clear();
|
diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs
--- a/crates/bevy_ui/src/layout/mod.rs
+++ b/crates/bevy_ui/src/layout/mod.rs
@@ -1000,4 +1014,65 @@ mod tests {
}
}
}
+
+ #[test]
+ fn no_camera_ui() {
+ let mut world = World::new();
+ world.init_resource::<UiScale>();
+ world.init_resource::<UiSurface>();
+ world.init_resource::<Events<WindowScaleFactorChanged>>();
+ world.init_resource::<Events<WindowResized>>();
+ // Required for the camera system
+ world.init_resource::<Events<WindowCreated>>();
+ world.init_resource::<Events<AssetEvent<Image>>>();
+ world.init_resource::<Assets<Image>>();
+ world.init_resource::<ManualTextureViews>();
+
+ // spawn a dummy primary window and camera
+ world.spawn((
+ Window {
+ resolution: WindowResolution::new(WINDOW_WIDTH, WINDOW_HEIGHT),
+ ..default()
+ },
+ PrimaryWindow,
+ ));
+
+ let mut ui_schedule = Schedule::default();
+ ui_schedule.add_systems(
+ (
+ // UI is driven by calculated camera target info, so we need to run the camera system first
+ bevy_render::camera::camera_system::<OrthographicProjection>,
+ update_target_camera_system,
+ apply_deferred,
+ ui_layout_system,
+ )
+ .chain(),
+ );
+
+ let ui_root = world
+ .spawn(NodeBundle {
+ style: Style {
+ width: Val::Percent(100.),
+ height: Val::Percent(100.),
+ ..default()
+ },
+ ..default()
+ })
+ .id();
+
+ let ui_child = world
+ .spawn(NodeBundle {
+ style: Style {
+ width: Val::Percent(100.),
+ height: Val::Percent(100.),
+ ..default()
+ },
+ ..default()
+ })
+ .id();
+
+ world.entity_mut(ui_root).add_child(ui_child);
+
+ ui_schedule.run(&mut world);
+ }
}
|
Panic with UI hierarchy when no camera is present
## Bevy version
main, 0.13
bisected to #10559
## Relevant system information
```
AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 14.2.1 ", kernel: "23.2.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }
```
## What you did
I noticed this while writing some doc examples which were accidentally not `no_run`.
This is the most minimal repro I can make, but I also see this panic in e.g. the `button` example modified with no camera.
```rust
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands
.spawn(NodeBundle::default())
.with_children(|parent| {
parent.spawn(NodeBundle::default());
});
}
```
## What went wrong
Received a warning about a camera not being present, which I suppose makes sense.
Received a warning about an "unstyled child in a UI entity hierarchy" which does not make sense as far as I can tell.
Finally, panicked on an `unwrap` which doesn't seem desirable.
```
2024-02-28T15:05:02.776557Z WARN bevy_ui::layout: No camera found to render UI to. To fix this, add at least one camera to the scene.
2024-02-28T15:05:02.776596Z WARN bevy_ui::layout: Unstyled child in a UI entity hierarchy. You are using an entity without UI components as a child of an entity with UI components, results may be unexpected.
thread 'Compute Task Pool (0)' panicked at crates/bevy_ui/src/layout/mod.rs:131:60:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_ui::layout::ui_layout_system`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
thread 'main' panicked at /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/macos/app_state.rs:387:33:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
```
|
I want to work on this issue, if it's OK
|
2024-03-31T21:44:08Z
|
1.77
|
2024-04-22T16:56:20Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"layout::tests::no_camera_ui"
] |
[
"geometry::tests::default_val_equals_const_default_val",
"geometry::tests::test_uirect_axes",
"geometry::tests::uirect_default_equals_const_default",
"geometry::tests::uirect_px",
"geometry::tests::uirect_percent",
"geometry::tests::val_auto_is_non_resolveable",
"geometry::tests::val_evaluate",
"geometry::tests::val_arithmetic_error_messages",
"geometry::tests::val_resolve_px",
"geometry::tests::val_resolve_viewport_coords",
"layout::convert::tests::test_into_length_percentage",
"layout::convert::tests::test_convert_from",
"layout::tests::round_layout_coords_must_round_ties_up",
"ui_node::tests::grid_placement_accessors",
"ui_node::tests::invalid_grid_placement_values",
"stack::tests::test_ui_stack_system",
"layout::tests::ui_node_should_be_set_to_its_content_size",
"layout::tests::ui_surface_tracks_ui_entities",
"layout::tests::measure_funcs_should_be_removed_on_content_size_removal",
"layout::tests::ui_surface_tracks_camera_entities",
"layout::tests::ui_root_node_should_act_like_position_absolute",
"layout::tests::ui_nodes_with_percent_100_dimensions_should_fill_their_parent",
"layout::tests::despawning_a_ui_entity_should_remove_its_corresponding_ui_node - should panic",
"layout::tests::changes_to_children_of_a_ui_entity_change_its_corresponding_ui_nodes_children",
"layout::tests::ui_node_should_properly_update_when_changing_target_camera",
"layout::tests::ui_rounding_test",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect (line 239)",
"crates/bevy_ui/src/ui_node.rs - ui_node::BorderRadius (line 1825)",
"crates/bevy_ui/src/ui_node.rs - ui_node::Outline (line 1677)",
"crates/bevy_ui/src/ui_node.rs - ui_node::IsDefaultUiCamera (line 2136)",
"crates/bevy_ui/src/ui_node.rs - ui_node::Outline (line 1656)",
"crates/bevy_ui/src/ui_material.rs - ui_material::UiMaterial (line 23)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect (line 224)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::vertical (line 411)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::with_top (line 582)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::with_left (line 544)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::px (line 341)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::right (line 479)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::with_bottom (line 601)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::axes (line 433)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::with_right (line 563)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::left (line 457)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::all (line 316)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect (line 214)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::percent (line 365)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::horizontal (line 388)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::new (line 288)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::top (line 501)",
"crates/bevy_ui/src/ui_node.rs - ui_node::Style::padding (line 323)",
"crates/bevy_ui/src/ui_node.rs - ui_node::Style::margin (line 301)",
"crates/bevy_ui/src/geometry.rs - geometry::UiRect::bottom (line 523)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 12,738
|
bevyengine__bevy-12738
|
[
"12736"
] |
221d925e9098ee3f0c83237e8b96e49b62cebcea
|
diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs
--- a/crates/bevy_sprite/src/lib.rs
+++ b/crates/bevy_sprite/src/lib.rs
@@ -194,14 +194,18 @@ pub fn calculate_bounds_2d(
}
}
for (entity, sprite, texture_handle, atlas) in &sprites_to_recalculate_aabb {
- if let Some(size) = sprite.custom_size.or_else(|| match atlas {
- // We default to the texture size for regular sprites
- None => images.get(texture_handle).map(|image| image.size_f32()),
- // We default to the drawn rect for atlas sprites
- Some(atlas) => atlas
- .texture_rect(&atlases)
- .map(|rect| rect.size().as_vec2()),
- }) {
+ if let Some(size) = sprite
+ .custom_size
+ .or_else(|| sprite.rect.map(|rect| rect.size()))
+ .or_else(|| match atlas {
+ // We default to the texture size for regular sprites
+ None => images.get(texture_handle).map(|image| image.size_f32()),
+ // We default to the drawn rect for atlas sprites
+ Some(atlas) => atlas
+ .texture_rect(&atlases)
+ .map(|rect| rect.size().as_vec2()),
+ })
+ {
let aabb = Aabb {
center: (-sprite.anchor.as_vec() * size).extend(0.0).into(),
half_extents: (0.5 * size).extend(0.0).into(),
|
diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs
--- a/crates/bevy_sprite/src/lib.rs
+++ b/crates/bevy_sprite/src/lib.rs
@@ -226,7 +230,7 @@ impl ExtractComponent for SpriteSource {
#[cfg(test)]
mod test {
- use bevy_math::Vec2;
+ use bevy_math::{Rect, Vec2, Vec3A};
use bevy_utils::default;
use super::*;
diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs
--- a/crates/bevy_sprite/src/lib.rs
+++ b/crates/bevy_sprite/src/lib.rs
@@ -336,4 +340,52 @@ mod test {
// Check that the AABBs are not equal
assert_ne!(first_aabb, second_aabb);
}
+
+ #[test]
+ fn calculate_bounds_2d_correct_aabb_for_sprite_with_custom_rect() {
+ // Setup app
+ let mut app = App::new();
+
+ // Add resources and get handle to image
+ let mut image_assets = Assets::<Image>::default();
+ let image_handle = image_assets.add(Image::default());
+ app.insert_resource(image_assets);
+ let mesh_assets = Assets::<Mesh>::default();
+ app.insert_resource(mesh_assets);
+ let texture_atlas_assets = Assets::<TextureAtlasLayout>::default();
+ app.insert_resource(texture_atlas_assets);
+
+ // Add system
+ app.add_systems(Update, calculate_bounds_2d);
+
+ // Add entities
+ let entity = app
+ .world_mut()
+ .spawn((
+ Sprite {
+ rect: Some(Rect::new(0., 0., 0.5, 1.)),
+ anchor: Anchor::TopRight,
+ ..default()
+ },
+ image_handle,
+ ))
+ .id();
+
+ // Create AABB
+ app.update();
+
+ // Get the AABB
+ let aabb = *app
+ .world_mut()
+ .get_entity(entity)
+ .expect("Could not find entity")
+ .get::<Aabb>()
+ .expect("Could not find AABB");
+
+ // Verify that the AABB is at the expected position
+ assert_eq!(aabb.center, Vec3A::new(-0.25, -0.5, 0.));
+
+ // Verify that the AABB has the expected size
+ assert_eq!(aabb.half_extents, Vec3A::new(0.25, 0.5, 0.));
+ }
}
|
Sprite with rect and custom anchor doesn't render when it should
## Bevy version
0.13.0 and b7ab1466c7ac2c6f20a37e47db9b8d889a940611
## Relevant system information
```ignore
`AdapterInfo { name: "Intel(R) Xe Graphics (TGL GT2)", vendor: 32902, device: 39497, device_type: Integrate
dGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 22.2.5-0ubuntu0.1~22.04.3", backend: Vulkan }`
```
## What you did
I have a sprite that has both a custom anchor (outside of the range -0.5..0.5) and a rect. See this minimal example:
```rs
use bevy::{prelude::*, sprite::Anchor};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(Update, update_camera)
.run();
}
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(SpriteBundle {
texture: asset_server.load("branding/bevy_bird_dark.png"),
sprite: Sprite {
anchor: Anchor::Custom(Vec2::new(1., 1.)),
rect: Some(Rect::new(0.0, 0.0, 150., 150.)),
..default()
},
..default()
});
}
fn update_camera(
keyboard: Res<ButtonInput<KeyCode>>,
time: Res<Time>,
mut listeners: Query<&mut Transform, With<Camera>>,
) {
let mut transform = listeners.single_mut();
let speed = 200.;
if keyboard.pressed(KeyCode::ArrowRight) {
transform.translation.x += speed * time.delta_seconds();
}
if keyboard.pressed(KeyCode::ArrowLeft) {
transform.translation.x -= speed * time.delta_seconds();
}
if keyboard.pressed(KeyCode::ArrowUp) {
transform.translation.y += speed * time.delta_seconds();
}
if keyboard.pressed(KeyCode::ArrowDown) {
transform.translation.y -= speed * time.delta_seconds();
}
}
```
## What went wrong
It doesn't render the sprite when the camera is almost out of view of the sprite.
|
2024-03-26T19:40:47Z
|
1.77
|
2024-04-16T16:50:34Z
|
257fec996fedfe8e3757b11720eb2ab8a21fbbb5
|
[
"test::calculate_bounds_2d_correct_aabb_for_sprite_with_custom_rect"
] |
[
"test::calculate_bounds_2d_create_aabb_for_image_sprite_entity",
"test::calculate_bounds_2d_update_aabb_when_sprite_custom_size_changes_to_some",
"crates/bevy_sprite/src/mesh2d/material.rs - mesh2d::material::Material2d (line 54)",
"crates/bevy_sprite/src/texture_atlas_builder.rs - texture_atlas_builder::TextureAtlasBuilder<'a>::finish (line 160)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 12,469
|
bevyengine__bevy-12469
|
[
"12139",
"12139"
] |
4b64d1d1d721a6974a6a06e57749227806f6835c
|
diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs
--- a/crates/bevy_ecs/src/entity/mod.rs
+++ b/crates/bevy_ecs/src/entity/mod.rs
@@ -139,7 +139,7 @@ type IdCursor = isize;
/// [`Query::get`]: crate::system::Query::get
/// [`World`]: crate::world::World
/// [SemVer]: https://semver.org/
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
#[cfg_attr(
feature = "bevy_reflect",
diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs
--- a/crates/bevy_ecs/src/entity/mod.rs
+++ b/crates/bevy_ecs/src/entity/mod.rs
@@ -384,9 +384,15 @@ impl<'de> Deserialize<'de> for Entity {
}
}
-impl fmt::Debug for Entity {
+impl fmt::Display for Entity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "{}v{}", self.index(), self.generation())
+ write!(
+ f,
+ "{}v{}|{}",
+ self.index(),
+ self.generation(),
+ self.to_bits()
+ )
}
}
|
diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs
--- a/crates/bevy_ecs/src/entity/mod.rs
+++ b/crates/bevy_ecs/src/entity/mod.rs
@@ -1147,4 +1153,14 @@ mod tests {
assert_ne!(hash, first_hash);
}
}
+
+ #[test]
+ fn entity_display() {
+ let entity = Entity::from_raw(42);
+ let string = format!("{}", entity);
+ let bits = entity.to_bits().to_string();
+ assert!(string.contains("42"));
+ assert!(string.contains("v1"));
+ assert!(string.contains(&bits));
+ }
}
|
Inconsistency between `Debug` and serialized representation of `Entity`
## Bevy version
0.13
## What went wrong
There is an inconsistency between the `Debug` representation of an `Entity`:
```rust
impl fmt::Debug for Entity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}v{}", self.index(), self.generation())
}
}
```
And its `Serialize` representation:
```rust
impl Serialize for Entity {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_u64(self.to_bits())
}
}
```
This makes it difficult to debug serialized outputs, since the serialized entity IDs cannot be easily mapped to runtime entities via human inspection. Ideally, these representations should be consistent for easier debugging.
## Additional information
I wanted to just open a PR on this, but I think the issue warrants some discussion. Mainly on two points:
- Which representation is "correct"?
- If we swap to #v# format for serialized data, are we ok with invalidating existing scenes?
Inconsistency between `Debug` and serialized representation of `Entity`
## Bevy version
0.13
## What went wrong
There is an inconsistency between the `Debug` representation of an `Entity`:
```rust
impl fmt::Debug for Entity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}v{}", self.index(), self.generation())
}
}
```
And its `Serialize` representation:
```rust
impl Serialize for Entity {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_u64(self.to_bits())
}
}
```
This makes it difficult to debug serialized outputs, since the serialized entity IDs cannot be easily mapped to runtime entities via human inspection. Ideally, these representations should be consistent for easier debugging.
## Additional information
I wanted to just open a PR on this, but I think the issue warrants some discussion. Mainly on two points:
- Which representation is "correct"?
- If we swap to #v# format for serialized data, are we ok with invalidating existing scenes?
|
Ah: I know what we should do. The serialized representation should stay the same, optimized for information density. This is just an opaque identifier. However, we should make the debug representation more verbose, and report `index`, `generation` and `raw_bits` separately.
In the future, we will be packing more information into here (e.g. entity disabling) that we want to add to the debug output, but we should avoid adding bloat (or semantic meaning) to the serialized representation. Displaying the raw bits separately gives us the best of both worlds, as users will be able to make this correspondence themselves.
I like that idea.
My only concern there is that the current "#v#" format for `Debug` is very compact. This makes it very useful for log messages, since the user can just do `info!("{entity:?} is a cool entity!")`.
This would output something like:
"2v2 is a cool entity"
I'm concerned if we make the `Debug` more verbose, we'd lose this feature. This would open the door to people using either the entity index/generation or the raw bits in log messages, which would produce highly inconsistent log outputs overall.
> I'm concerned if we make the Debug more verbose, we'd lose this feature. This would open the door to people using either the entity index/generation or the raw bits in log messages, which would produce highly inconsistent log outputs overall.
That seems like a prime case for a `Display` impl then: "pretty, humand-readable output" is what belongs there. `Debug` should be maximally clear and helpful IMO.
Just a random idea I had on this topic:
If we take this approach, we could make the `Debug` impl compact as well. Maybe if we pick a format like: `#v#[raw_bits]`
So then `Display` could look like `12v7`. And `Debug` could look like `12v7[12345678]` or `12v7.12345678`
Alternatively, we could make `Display` use the `12v7.12345678` format, and `Debug` to be even more verbose with field names as needed.
I like `12v7[12345678]` for the display impl, and then a properly verbose Debug impl :)
Ah: I know what we should do. The serialized representation should stay the same, optimized for information density. This is just an opaque identifier. However, we should make the debug representation more verbose, and report `index`, `generation` and `raw_bits` separately.
In the future, we will be packing more information into here (e.g. entity disabling) that we want to add to the debug output, but we should avoid adding bloat (or semantic meaning) to the serialized representation. Displaying the raw bits separately gives us the best of both worlds, as users will be able to make this correspondence themselves.
I like that idea.
My only concern there is that the current "#v#" format for `Debug` is very compact. This makes it very useful for log messages, since the user can just do `info!("{entity:?} is a cool entity!")`.
This would output something like:
"2v2 is a cool entity"
I'm concerned if we make the `Debug` more verbose, we'd lose this feature. This would open the door to people using either the entity index/generation or the raw bits in log messages, which would produce highly inconsistent log outputs overall.
> I'm concerned if we make the Debug more verbose, we'd lose this feature. This would open the door to people using either the entity index/generation or the raw bits in log messages, which would produce highly inconsistent log outputs overall.
That seems like a prime case for a `Display` impl then: "pretty, humand-readable output" is what belongs there. `Debug` should be maximally clear and helpful IMO.
Just a random idea I had on this topic:
If we take this approach, we could make the `Debug` impl compact as well. Maybe if we pick a format like: `#v#[raw_bits]`
So then `Display` could look like `12v7`. And `Debug` could look like `12v7[12345678]` or `12v7.12345678`
Alternatively, we could make `Display` use the `12v7.12345678` format, and `Debug` to be even more verbose with field names as needed.
I like `12v7[12345678]` for the display impl, and then a properly verbose Debug impl :)
|
2024-03-14T04:35:47Z
|
1.76
|
2024-03-14T23:54:21Z
|
c9ec95d7827297528d0779e3fd232dfc2e3cbed7
|
[
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::map_mut",
"change_detection::tests::as_deref_mut",
"bundle::tests::component_hook_order_spawn_despawn",
"change_detection::tests::mut_from_res_mut",
"bundle::tests::component_hook_order_insert_remove",
"change_detection::tests::mut_new",
"bundle::tests::component_hook_order_recursive",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::change_tick_wraparound",
"bundle::tests::component_hook_order_recursive_multiple",
"change_detection::tests::change_tick_scan",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::change_expiration",
"change_detection::tests::set_if_neq",
"entity::map_entities::tests::entity_mapper",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_comparison",
"entity::tests::entity_const",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_len_updated",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_send_events_ids",
"event::tests::test_firing_empty_event",
"event::tests::test_update_drain",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::id_comparison",
"identifier::tests::from_bits",
"query::access::tests::filtered_access_extend",
"identifier::tests::id_construction",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_combined_access",
"query::access::tests::read_all_access_conflicts",
"query::builder::tests::builder_dynamic_components",
"query::builder::tests::builder_static_components",
"query::builder::tests::builder_transmute",
"query::builder::tests::builder_or",
"query::builder::tests::builder_with_without_static",
"query::builder::tests::builder_with_without_dynamic",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_phantom_data",
"query::fetch::tests::world_query_metadata_collision",
"query::fetch::tests::world_query_struct_variants",
"query::state::tests::can_generalize_with_option",
"query::state::tests::can_transmute_added",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::tests::has_query",
"query::tests::any_query",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::join_with_get",
"query::state::tests::join",
"query::tests::many_entities",
"query::tests::multi_storage_query",
"query::tests::query",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::query_iter_combinations",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::tests::derived_worldqueries",
"reflect::entity_commands::tests::remove_reflected",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::tests::self_conflicting_worldquery - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::tests::query_filtered_iter_combinations",
"query::tests::query_iter_combinations_sparse",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"schedule::condition::tests::distributive_run_if_compiles",
"schedule::executor::simple::skip_automatic_sync_points",
"schedule::set::tests::test_derive_schedule_label",
"schedule::set::tests::test_derive_system_set",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::clear_system",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::stepping::tests::continue_breakpoint",
"schedule::tests::stepping::simple_executor",
"schedule::stepping::tests::unknown_schedule",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::stepping::tests::schedules",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::tests::stepping::single_threaded_executor",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::stepping::tests::remove_schedule",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::stepping::tests::waiting_always_run",
"schedule::stepping::tests::step_always_run",
"schedule::stepping::tests::stepping_disabled",
"schedule::stepping::tests::waiting_never_run",
"schedule::stepping::tests::step_never_run",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::system_ambiguity::read_world",
"schedule::stepping::tests::step_breakpoint",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::system_ambiguity::events",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ambiguity::before_and_after",
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"storage::sparse_set::tests::sparse_set",
"storage::sparse_set::tests::sparse_sets",
"storage::blob_vec::tests::resize_test",
"system::commands::tests::append",
"schedule::tests::system_ambiguity::correct_ambiguities",
"storage::table::tests::table",
"schedule::tests::system_ambiguity::read_only",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::commands::tests::remove_resources",
"system::commands::tests::commands",
"system::function_system::tests::into_system_type_id_consistency",
"schedule::stepping::tests::verify_cursor",
"system::commands::tests::remove_components",
"system::system::tests::command_processing",
"system::system::tests::run_system_once",
"system::system::tests::non_send_resources",
"system::system::tests::run_two_systems",
"system::system_name::tests::test_system_name_exclusive_param",
"system::system_name::tests::test_system_name_regular_param",
"system::system_param::tests::system_param_const_generics",
"system::system_param::tests::system_param_flexibility",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_invariant_lifetime",
"schedule::tests::stepping::multi_threaded_executor",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"system::system_param::tests::system_param_phantom_data",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"system::system_param::tests::system_param_where_clause",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::tests::system_ordering::order_exclusive_systems",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_struct_variants",
"system::system_registry::tests::change_detection",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"system::system_registry::tests::exclusive_system",
"system::system_param::tests::system_param_generic_bounds",
"system::system_registry::tests::output_values",
"system::system_registry::tests::nested_systems_with_inputs",
"system::system_registry::tests::local_variables",
"system::system_registry::tests::input_values",
"system::system_param::tests::system_param_field_limit",
"schedule::tests::conditions::systems_nested_in_system_sets",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"system::system_param::tests::param_set_non_send_first",
"schedule::tests::conditions::system_with_condition",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::tests::conditions::system_conditions_and_change_detection",
"system::system_param::tests::param_set_non_send_second",
"schedule::set::tests::test_schedule_label",
"schedule::stepping::tests::step_run_if_false",
"schedule::condition::tests::multiple_run_conditions",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::schedule::tests::inserts_a_sync_point",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::tests::system_execution::run_system",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::conditions::systems_with_distributive_condition",
"system::tests::any_of_has_no_filter_with - should panic",
"schedule::condition::tests::run_condition_combinators",
"system::tests::assert_system_does_not_conflict - should panic",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"system::tests::any_of_has_filter_with_when_both_have_it",
"event::tests::test_event_iter_nth",
"system::tests::any_of_and_without",
"system::tests::assert_systems",
"system::tests::commands_param_set",
"system::system_param::tests::non_sync_local",
"system::system_registry::tests::nested_systems",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"schedule::condition::tests::run_condition",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_system_resources - should panic",
"system::tests::get_system_conflicts",
"schedule::tests::system_ordering::order_systems",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::long_life_test",
"system::tests::conflicting_query_mut_system - should panic",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::immutable_mut_test",
"query::tests::par_iter_mut_change_detection",
"system::tests::disjoint_query_mut_system",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::convert_mut_to_immut",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"system::tests::changed_resource_system",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::non_send_option_system",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::into_iter_impl",
"system::tests::local_system",
"schedule::schedule::tests::no_sync_chain::chain_all",
"system::tests::nonconflicting_system_resources",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::non_send_system",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::pipe_change_detection",
"system::tests::or_has_filter_with",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::query_is_empty",
"system::tests::query_validates_world_id - should panic",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::read_system_state",
"system::tests::simple_system",
"system::tests::query_set_system",
"system::tests::system_state_change_detection",
"system::tests::system_state_invalid_world - should panic",
"system::tests::panic_inside_system - should panic",
"system::tests::or_param_set_system",
"system::tests::system_state_archetype_update",
"system::tests::write_system_state",
"system::tests::update_archetype_component_access_works",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"tests::changed_query",
"system::tests::removal_tracking",
"tests::added_tracking",
"system::tests::world_collections_system",
"tests::despawn_mixed_storage",
"tests::bundle_derive",
"tests::added_queries",
"tests::clear_entities",
"tests::despawn_table_storage",
"tests::empty_spawn",
"tests::add_remove_components",
"tests::changed_trackers",
"tests::changed_trackers_sparse",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::duplicate_components_panic - should panic",
"system::tests::test_combinator_clone",
"tests::filtered_query_access",
"tests::exact_size_query",
"tests::insert_overwrite_drop",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop_sparse",
"tests::multiple_worlds_same_query_get - should panic",
"tests::insert_or_spawn_batch_invalid",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::non_send_resource",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::non_send_resource_points_to_distinct_data",
"tests::non_send_resource_panic - should panic",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::query_all",
"tests::query_all_for_each",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::query_filter_with_sparse",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_without",
"tests::query_filter_with_sparse_for_each",
"tests::par_for_each_dense",
"tests::query_get",
"tests::query_get_works_across_sparse_removal",
"tests::par_for_each_sparse",
"tests::query_missing_component",
"tests::query_optional_component_sparse",
"tests::remove",
"tests::query_optional_component_sparse_no_match",
"tests::remove_missing",
"tests::query_optional_component_table",
"tests::query_single_component_for_each",
"tests::reserve_and_spawn",
"tests::query_sparse_component",
"tests::query_single_component",
"tests::resource",
"tests::resource_scope",
"tests::random_access",
"tests::remove_tracking",
"tests::reserve_entities_across_worlds",
"tests::sparse_set_add_remove_many",
"tests::spawn_batch",
"tests::ref_and_mut_query_panic - should panic",
"query::tests::query_filtered_exactsizeiterator_len",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_is_send",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_queue_inner",
"world::command_queue::test::test_command_queue_inner_drop_early",
"tests::take",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_exclusive_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_by_id",
"world::identifier::tests::world_id_system_param",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::tests::spawn_empty_bundle",
"world::world_cell::tests::world_access_reused",
"world::tests::iterate_entities_mut",
"world::tests::panic_while_overwriting_component",
"world::world_cell::tests::world_cell",
"world::tests::inspect_entity_components",
"world::tests::iterate_entities",
"world::world_cell::tests::world_cell_double_mut - should panic",
"world::world_cell::tests::world_cell_ref_and_ref",
"world::world_cell::tests::world_cell_mut_and_ref - should panic",
"world::world_cell::tests::world_cell_ref_and_mut - should panic",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 910) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 129) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 866) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 235) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 98) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 858) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 245) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 83)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 34)",
"crates/bevy_ecs/src/component.rs - component::Component (line 104)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 23)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 58)",
"crates/bevy_ecs/src/lib.rs - (line 290)",
"crates/bevy_ecs/src/component.rs - component::Component (line 139)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 635)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/lib.rs - (line 192)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 189)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 114)",
"crates/bevy_ecs/src/lib.rs - (line 215)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 926)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 449)",
"crates/bevy_ecs/src/component.rs - component::Component (line 39)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 96)",
"crates/bevy_ecs/src/component.rs - component::Component (line 85)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 506)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 31)",
"crates/bevy_ecs/src/lib.rs - (line 242)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 166)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 101)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 214)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::States (line 33)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 463)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::State (line 78)",
"crates/bevy_ecs/src/lib.rs - (line 168)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 55)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 738)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 532)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::NextState (line 146)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 100)",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/event.rs - event::Events (line 118)",
"crates/bevy_ecs/src/event.rs - event::ManualEventReader (line 573)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 124)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 180)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 134)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 259)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1388)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/event.rs - event::EventReader<'w,'s,E>::is_empty (line 449)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 690)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 103)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 586)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 100)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 287) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 256)",
"crates/bevy_ecs/src/lib.rs - (line 127)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 255)",
"crates/bevy_ecs/src/lib.rs - (line 257)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 483)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 652)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 556)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 244)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 540)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 82)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_exists (line 665)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 620)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1365)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 120)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 294)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 133)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 132)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::add (line 868)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 425)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::retain (line 891)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 214)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 188)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1197)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 619)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 888) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 996) - compile",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 349)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 832)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_changed (line 779)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 488)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 451)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 526)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 57)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 923)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 351)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 800)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 138)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 382)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 410) - compile fail",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 550)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1441) - compile fail",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 323)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 140)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1500)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 529)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 309)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 37)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1417)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 375)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::try_insert (line 746)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 421)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 197)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 479)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::remove (line 792)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 820)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 176)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 763)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 9)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 785)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 876)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1543)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 211)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 478)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 41)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 579)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::id (line 658)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 938)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 57)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 559)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 190)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 425)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 225)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 295)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1102)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 616)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 174)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 699)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 232)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1296)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 252)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::despawn (line 845)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1074)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 610)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 333)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 187)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 112) - compile",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1410)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 101)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 22)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1220)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 114)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1149)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 45)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 147)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1253)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 676)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 417)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1383)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 805)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1494)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 269)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 298)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 254)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 219)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1179)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 455)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'_>::insert (line 693)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::in_state (line 710)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1437)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 271)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 345)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 255)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1292)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1165)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 24)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1685)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1067)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 393)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 332)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1218)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1036)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 438)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1351)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1266)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 970)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 758)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 849)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1470)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1517)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 254)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1377)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 184)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1322)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1574)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 565)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 311)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 512)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 1937)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 167)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 285)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 208)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 381)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 875)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1000)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 896)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1573)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2300)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 547)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 666)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 384)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 928)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 635)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 427)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 75)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 725)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1549)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 12,399
|
bevyengine__bevy-12399
|
[
"12200"
] |
ba0f033e8f9dfed3d3a37aea97fbe6481dd2f905
|
diff --git a/crates/bevy_color/src/color_ops.rs b/crates/bevy_color/src/color_ops.rs
--- a/crates/bevy_color/src/color_ops.rs
+++ b/crates/bevy_color/src/color_ops.rs
@@ -62,6 +62,24 @@ pub trait Alpha: Sized {
}
}
+/// Trait for manipulating the hue of a color.
+pub trait Hue: Sized {
+ /// Return a new version of this color with the hue channel set to the given value.
+ fn with_hue(&self, hue: f32) -> Self;
+
+ /// Return the hue of this color [0.0, 360.0].
+ fn hue(&self) -> f32;
+
+ /// Sets the hue of this color.
+ fn set_hue(&mut self, hue: f32);
+
+ /// Return a new version of this color with the hue channel rotated by the given degrees.
+ fn rotate_hue(&self, degrees: f32) -> Self {
+ let rotated_hue = (self.hue() + degrees).rem_euclid(360.);
+ self.with_hue(rotated_hue)
+ }
+}
+
/// Trait with methods for asserting a colorspace is within bounds.
///
/// During ordinary usage (e.g. reading images from disk, rendering images, picking colors for UI), colors should always be within their ordinary bounds (such as 0 to 1 for RGB colors).
diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs
--- a/crates/bevy_color/src/hsla.rs
+++ b/crates/bevy_color/src/hsla.rs
@@ -1,5 +1,6 @@
use crate::{
- Alpha, ClampColor, Hsva, Hwba, Lcha, LinearRgba, Luminance, Mix, Srgba, StandardColor, Xyza,
+ Alpha, ClampColor, Hsva, Hue, Hwba, Lcha, LinearRgba, Luminance, Mix, Srgba, StandardColor,
+ Xyza,
};
use bevy_reflect::prelude::*;
use serde::{Deserialize, Serialize};
diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs
--- a/crates/bevy_color/src/hsla.rs
+++ b/crates/bevy_color/src/hsla.rs
@@ -54,11 +55,6 @@ impl Hsla {
Self::new(hue, saturation, lightness, 1.0)
}
- /// Return a copy of this color with the hue channel set to the given value.
- pub const fn with_hue(self, hue: f32) -> Self {
- Self { hue, ..self }
- }
-
/// Return a copy of this color with the saturation channel set to the given value.
pub const fn with_saturation(self, saturation: f32) -> Self {
Self { saturation, ..self }
diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs
--- a/crates/bevy_color/src/hsla.rs
+++ b/crates/bevy_color/src/hsla.rs
@@ -143,6 +139,23 @@ impl Alpha for Hsla {
}
}
+impl Hue for Hsla {
+ #[inline]
+ fn with_hue(&self, hue: f32) -> Self {
+ Self { hue, ..*self }
+ }
+
+ #[inline]
+ fn hue(&self) -> f32 {
+ self.hue
+ }
+
+ #[inline]
+ fn set_hue(&mut self, hue: f32) {
+ self.hue = hue;
+ }
+}
+
impl Luminance for Hsla {
#[inline]
fn with_luminance(&self, lightness: f32) -> Self {
diff --git a/crates/bevy_color/src/hsva.rs b/crates/bevy_color/src/hsva.rs
--- a/crates/bevy_color/src/hsva.rs
+++ b/crates/bevy_color/src/hsva.rs
@@ -1,4 +1,4 @@
-use crate::{Alpha, ClampColor, Hwba, Lcha, LinearRgba, Srgba, StandardColor, Xyza};
+use crate::{Alpha, ClampColor, Hue, Hwba, Lcha, LinearRgba, Srgba, StandardColor, Xyza};
use bevy_reflect::prelude::*;
use serde::{Deserialize, Serialize};
diff --git a/crates/bevy_color/src/hsva.rs b/crates/bevy_color/src/hsva.rs
--- a/crates/bevy_color/src/hsva.rs
+++ b/crates/bevy_color/src/hsva.rs
@@ -52,11 +52,6 @@ impl Hsva {
Self::new(hue, saturation, value, 1.0)
}
- /// Return a copy of this color with the hue channel set to the given value.
- pub const fn with_hue(self, hue: f32) -> Self {
- Self { hue, ..self }
- }
-
/// Return a copy of this color with the saturation channel set to the given value.
pub const fn with_saturation(self, saturation: f32) -> Self {
Self { saturation, ..self }
diff --git a/crates/bevy_color/src/hsva.rs b/crates/bevy_color/src/hsva.rs
--- a/crates/bevy_color/src/hsva.rs
+++ b/crates/bevy_color/src/hsva.rs
@@ -91,6 +86,23 @@ impl Alpha for Hsva {
}
}
+impl Hue for Hsva {
+ #[inline]
+ fn with_hue(&self, hue: f32) -> Self {
+ Self { hue, ..*self }
+ }
+
+ #[inline]
+ fn hue(&self) -> f32 {
+ self.hue
+ }
+
+ #[inline]
+ fn set_hue(&mut self, hue: f32) {
+ self.hue = hue;
+ }
+}
+
impl ClampColor for Hsva {
fn clamped(&self) -> Self {
Self {
diff --git a/crates/bevy_color/src/hwba.rs b/crates/bevy_color/src/hwba.rs
--- a/crates/bevy_color/src/hwba.rs
+++ b/crates/bevy_color/src/hwba.rs
@@ -2,7 +2,7 @@
//! in [_HWB - A More Intuitive Hue-Based Color Model_] by _Smith et al_.
//!
//! [_HWB - A More Intuitive Hue-Based Color Model_]: https://web.archive.org/web/20240226005220/http://alvyray.com/Papers/CG/HWB_JGTv208.pdf
-use crate::{Alpha, ClampColor, Lcha, LinearRgba, Srgba, StandardColor, Xyza};
+use crate::{Alpha, ClampColor, Hue, Lcha, LinearRgba, Srgba, StandardColor, Xyza};
use bevy_reflect::prelude::*;
use serde::{Deserialize, Serialize};
diff --git a/crates/bevy_color/src/hwba.rs b/crates/bevy_color/src/hwba.rs
--- a/crates/bevy_color/src/hwba.rs
+++ b/crates/bevy_color/src/hwba.rs
@@ -56,11 +56,6 @@ impl Hwba {
Self::new(hue, whiteness, blackness, 1.0)
}
- /// Return a copy of this color with the hue channel set to the given value.
- pub const fn with_hue(self, hue: f32) -> Self {
- Self { hue, ..self }
- }
-
/// Return a copy of this color with the whiteness channel set to the given value.
pub const fn with_whiteness(self, whiteness: f32) -> Self {
Self { whiteness, ..self }
diff --git a/crates/bevy_color/src/hwba.rs b/crates/bevy_color/src/hwba.rs
--- a/crates/bevy_color/src/hwba.rs
+++ b/crates/bevy_color/src/hwba.rs
@@ -95,6 +90,23 @@ impl Alpha for Hwba {
}
}
+impl Hue for Hwba {
+ #[inline]
+ fn with_hue(&self, hue: f32) -> Self {
+ Self { hue, ..*self }
+ }
+
+ #[inline]
+ fn hue(&self) -> f32 {
+ self.hue
+ }
+
+ #[inline]
+ fn set_hue(&mut self, hue: f32) {
+ self.hue = hue;
+ }
+}
+
impl ClampColor for Hwba {
fn clamped(&self) -> Self {
Self {
diff --git a/crates/bevy_color/src/lcha.rs b/crates/bevy_color/src/lcha.rs
--- a/crates/bevy_color/src/lcha.rs
+++ b/crates/bevy_color/src/lcha.rs
@@ -1,4 +1,4 @@
-use crate::{Alpha, ClampColor, Laba, LinearRgba, Luminance, Mix, Srgba, StandardColor, Xyza};
+use crate::{Alpha, ClampColor, Hue, Laba, LinearRgba, Luminance, Mix, Srgba, StandardColor, Xyza};
use bevy_reflect::prelude::*;
use serde::{Deserialize, Serialize};
diff --git a/crates/bevy_color/src/lcha.rs b/crates/bevy_color/src/lcha.rs
--- a/crates/bevy_color/src/lcha.rs
+++ b/crates/bevy_color/src/lcha.rs
@@ -56,11 +56,6 @@ impl Lcha {
}
}
- /// Return a copy of this color with the hue channel set to the given value.
- pub const fn with_hue(self, hue: f32) -> Self {
- Self { hue, ..self }
- }
-
/// Return a copy of this color with the chroma channel set to the given value.
pub const fn with_chroma(self, chroma: f32) -> Self {
Self { chroma, ..self }
diff --git a/crates/bevy_color/src/lcha.rs b/crates/bevy_color/src/lcha.rs
--- a/crates/bevy_color/src/lcha.rs
+++ b/crates/bevy_color/src/lcha.rs
@@ -137,6 +132,23 @@ impl Alpha for Lcha {
}
}
+impl Hue for Lcha {
+ #[inline]
+ fn with_hue(&self, hue: f32) -> Self {
+ Self { hue, ..*self }
+ }
+
+ #[inline]
+ fn hue(&self) -> f32 {
+ self.hue
+ }
+
+ #[inline]
+ fn set_hue(&mut self, hue: f32) {
+ self.hue = hue;
+ }
+}
+
impl Luminance for Lcha {
#[inline]
fn with_luminance(&self, lightness: f32) -> Self {
diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs
--- a/crates/bevy_color/src/oklcha.rs
+++ b/crates/bevy_color/src/oklcha.rs
@@ -1,5 +1,5 @@
use crate::{
- color_difference::EuclideanDistance, Alpha, ClampColor, Hsla, Hsva, Hwba, Laba, Lcha,
+ color_difference::EuclideanDistance, Alpha, ClampColor, Hsla, Hsva, Hue, Hwba, Laba, Lcha,
LinearRgba, Luminance, Mix, Oklaba, Srgba, StandardColor, Xyza,
};
use bevy_reflect::prelude::*;
diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs
--- a/crates/bevy_color/src/oklcha.rs
+++ b/crates/bevy_color/src/oklcha.rs
@@ -65,11 +65,6 @@ impl Oklcha {
Self { chroma, ..self }
}
- /// Return a copy of this color with the 'hue' channel set to the given value.
- pub const fn with_hue(self, hue: f32) -> Self {
- Self { hue, ..self }
- }
-
/// Generate a deterministic but [quasi-randomly distributed](https://en.wikipedia.org/wiki/Low-discrepancy_sequence)
/// color from a provided `index`.
///
diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs
--- a/crates/bevy_color/src/oklcha.rs
+++ b/crates/bevy_color/src/oklcha.rs
@@ -136,6 +131,23 @@ impl Alpha for Oklcha {
}
}
+impl Hue for Oklcha {
+ #[inline]
+ fn with_hue(&self, hue: f32) -> Self {
+ Self { hue, ..*self }
+ }
+
+ #[inline]
+ fn hue(&self) -> f32 {
+ self.hue
+ }
+
+ #[inline]
+ fn set_hue(&mut self, hue: f32) {
+ self.hue = hue;
+ }
+}
+
impl Luminance for Oklcha {
#[inline]
fn with_luminance(&self, lightness: f32) -> Self {
diff --git a/examples/3d/animated_material.rs b/examples/3d/animated_material.rs
--- a/examples/3d/animated_material.rs
+++ b/examples/3d/animated_material.rs
@@ -30,14 +30,19 @@ fn setup(
));
let cube = meshes.add(Cuboid::new(0.5, 0.5, 0.5));
+
+ const GOLDEN_ANGLE: f32 = 137.507_77;
+
+ let mut hsla = Hsla::hsl(0.0, 1.0, 0.5);
for x in -1..2 {
for z in -1..2 {
commands.spawn(PbrBundle {
mesh: cube.clone(),
- material: materials.add(Color::WHITE),
+ material: materials.add(Color::from(hsla)),
transform: Transform::from_translation(Vec3::new(x as f32, 0.0, z as f32)),
..default()
});
+ hsla = hsla.rotate_hue(GOLDEN_ANGLE);
}
}
}
diff --git a/examples/3d/animated_material.rs b/examples/3d/animated_material.rs
--- a/examples/3d/animated_material.rs
+++ b/examples/3d/animated_material.rs
@@ -47,13 +52,11 @@ fn animate_materials(
time: Res<Time>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
- for (i, material_handle) in material_handles.iter().enumerate() {
+ for material_handle in material_handles.iter() {
if let Some(material) = materials.get_mut(material_handle) {
- material.base_color = Color::hsl(
- ((i as f32 * 2.345 + time.elapsed_seconds_wrapped()) * 100.0) % 360.0,
- 1.0,
- 0.5,
- );
+ if let Color::Hsla(ref mut hsla) = material.base_color {
+ *hsla = hsla.rotate_hue(time.delta_seconds() * 100.0);
+ }
}
}
}
|
diff --git a/crates/bevy_color/src/color_ops.rs b/crates/bevy_color/src/color_ops.rs
--- a/crates/bevy_color/src/color_ops.rs
+++ b/crates/bevy_color/src/color_ops.rs
@@ -78,3 +96,21 @@ pub trait ClampColor: Sized {
/// Are all the fields of this color in bounds?
fn is_within_bounds(&self) -> bool;
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use crate::Hsla;
+
+ #[test]
+ fn test_rotate_hue() {
+ let hsla = Hsla::hsl(180.0, 1.0, 0.5);
+ assert_eq!(hsla.rotate_hue(90.0), Hsla::hsl(270.0, 1.0, 0.5));
+ assert_eq!(hsla.rotate_hue(-90.0), Hsla::hsl(90.0, 1.0, 0.5));
+ assert_eq!(hsla.rotate_hue(180.0), Hsla::hsl(0.0, 1.0, 0.5));
+ assert_eq!(hsla.rotate_hue(-180.0), Hsla::hsl(0.0, 1.0, 0.5));
+ assert_eq!(hsla.rotate_hue(0.0), hsla);
+ assert_eq!(hsla.rotate_hue(360.0), hsla);
+ assert_eq!(hsla.rotate_hue(-360.0), hsla);
+ }
+}
|
Add hue rotation traits
Nit for future PR: We should add hue rotation traits to make this cleaner.
_Originally posted by @bushrat011899 in https://github.com/bevyengine/bevy/pull/12163#discussion_r1506997793_
Much like the `Alpha` trait, we should provide easy ways to "rotate" the hue of colors: shifting them by a provided number of degrees to rotate the metaphorical color wheel.
This trait should only be implemented for the color models (types) with an explicit hue element: other color types should be converted to one of those spaces first.
Once basic hue rotation is added, we can add nice color theory options: things like "complementary colors" (rotate by 180 degrees), "triadic colors" (rotate by 120 degrees), analogous colors and so on.
|
If nobody is working on it, I'll give it a try.
That would be lovely :) Feel free to open a draft PR and ping me if you run into difficulties.
|
2024-03-10T05:51:01Z
|
1.76
|
2024-05-03T20:25:31Z
|
c9ec95d7827297528d0779e3fd232dfc2e3cbed7
|
[
"hsla::tests::test_from_index",
"color_range::tests::test_color_range",
"hsla::tests::test_mix_wrap",
"hsla::tests::test_clamp",
"hsla::tests::test_to_from_srgba",
"hsla::tests::test_to_from_linear",
"hsla::tests::test_to_from_srgba_2",
"hsva::tests::test_clamp",
"hsva::tests::test_to_from_srgba",
"hsva::tests::test_to_from_srgba_2",
"hwba::tests::test_clamp",
"hwba::tests::test_to_from_srgba",
"hwba::tests::test_to_from_srgba_2",
"laba::tests::test_clamp",
"laba::tests::test_to_from_linear",
"laba::tests::test_to_from_srgba",
"lcha::tests::test_clamp",
"lcha::tests::test_to_from_linear",
"lcha::tests::test_to_from_srgba",
"linear_rgba::tests::darker_lighter",
"linear_rgba::tests::euclidean_distance",
"linear_rgba::tests::test_clamp",
"oklaba::tests::test_clamp",
"oklaba::tests::test_to_from_linear",
"oklaba::tests::test_to_from_srgba",
"oklaba::tests::test_to_from_srgba_2",
"oklcha::tests::test_clamp",
"oklcha::tests::test_to_from_linear",
"oklcha::tests::test_to_from_srgba",
"srgba::tests::darker_lighter",
"oklcha::tests::test_to_from_srgba_2",
"srgba::tests::euclidean_distance",
"srgba::tests::hex_color",
"srgba::tests::test_clamp",
"srgba::tests::test_to_from_linear",
"xyza::tests::test_clamp",
"xyza::tests::test_to_from_srgba",
"xyza::tests::test_to_from_srgba_2",
"crates/bevy_color/src/linear_rgba.rs - linear_rgba::LinearRgba (line 15)",
"crates/bevy_color/src/srgba.rs - srgba::Srgba::hex (line 118)",
"crates/bevy_color/src/xyza.rs - xyza::Xyza (line 12)",
"crates/bevy_color/src/laba.rs - laba::Laba (line 13)",
"crates/bevy_color/src/srgba.rs - srgba::Srgba (line 15)",
"crates/bevy_color/src/color.rs - color::Color (line 15)",
"crates/bevy_color/src/lib.rs - (line 58)",
"crates/bevy_color/src/hsva.rs - hsva::Hsva (line 11)",
"crates/bevy_color/src/lib.rs - (line 91)",
"crates/bevy_color/src/oklcha.rs - oklcha::Oklcha (line 13)",
"crates/bevy_color/src/hwba.rs - hwba::Hwba (line 15)",
"crates/bevy_color/src/lcha.rs - lcha::Lcha (line 10)",
"crates/bevy_color/src/oklaba.rs - oklaba::Oklaba (line 13)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 16,910
|
bevyengine__bevy-16910
|
[
"16676"
] |
65835f535493a14d4fabe3c1569de61be2e884b1
|
diff --git a/crates/bevy_math/src/curve/easing.rs b/crates/bevy_math/src/curve/easing.rs
--- a/crates/bevy_math/src/curve/easing.rs
+++ b/crates/bevy_math/src/curve/easing.rs
@@ -176,9 +176,15 @@ pub enum EaseFunction {
/// Behaves as `EaseFunction::CircularIn` for t < 0.5 and as `EaseFunction::CircularOut` for t >= 0.5
CircularInOut,
- /// `f(t) = 2.0^(10.0 * (t - 1.0))`
+ /// `f(t) ≈ 2.0^(10.0 * (t - 1.0))`
+ ///
+ /// The precise definition adjusts it slightly so it hits both `(0, 0)` and `(1, 1)`:
+ /// `f(t) = 2.0^(10.0 * t - A) - B`, where A = log₂(2¹⁰-1) and B = 1/(2¹⁰-1).
ExponentialIn,
- /// `f(t) = 1.0 - 2.0^(-10.0 * t)`
+ /// `f(t) ≈ 1.0 - 2.0^(-10.0 * t)`
+ ///
+ /// As with `EaseFunction::ExponentialIn`, the precise definition adjusts it slightly
+ // so it hits both `(0, 0)` and `(1, 1)`.
ExponentialOut,
/// Behaves as `EaseFunction::ExponentialIn` for t < 0.5 and as `EaseFunction::ExponentialOut` for t >= 0.5
ExponentialInOut,
diff --git a/crates/bevy_math/src/curve/easing.rs b/crates/bevy_math/src/curve/easing.rs
--- a/crates/bevy_math/src/curve/easing.rs
+++ b/crates/bevy_math/src/curve/easing.rs
@@ -324,20 +330,30 @@ mod easing_functions {
}
}
+ // These are copied from a high precision calculator; I'd rather show them
+ // with blatantly more digits than needed (since rust will round them to the
+ // nearest representable value anyway) rather than make it seem like the
+ // truncated value is somehow carefully chosen.
+ #[allow(clippy::excessive_precision)]
+ const LOG2_1023: f32 = 9.998590429745328646459226;
+ #[allow(clippy::excessive_precision)]
+ const FRAC_1_1023: f32 = 0.00097751710654936461388074291;
#[inline]
pub(crate) fn exponential_in(t: f32) -> f32 {
- ops::powf(2.0, 10.0 * t - 10.0)
+ // Derived from a rescaled exponential formula `(2^(10*t) - 1) / (2^10 - 1)`
+ // See <https://www.wolframalpha.com/input?i=solve+over+the+reals%3A+pow%282%2C+10-A%29+-+pow%282%2C+-A%29%3D+1>
+ ops::exp2(10.0 * t - LOG2_1023) - FRAC_1_1023
}
#[inline]
pub(crate) fn exponential_out(t: f32) -> f32 {
- 1.0 - ops::powf(2.0, -10.0 * t)
+ (FRAC_1_1023 + 1.0) - ops::exp2(-10.0 * t - (LOG2_1023 - 10.0))
}
#[inline]
pub(crate) fn exponential_in_out(t: f32) -> f32 {
if t < 0.5 {
- ops::powf(2.0, 20.0 * t - 10.0) / 2.0
+ ops::exp2(20.0 * t - (LOG2_1023 + 1.0)) - (FRAC_1_1023 / 2.0)
} else {
- (2.0 - ops::powf(2.0, -20.0 * t + 10.0)) / 2.0
+ (FRAC_1_1023 / 2.0 + 1.0) - ops::exp2(-20.0 * t - (LOG2_1023 - 19.0))
}
}
|
diff --git a/crates/bevy_math/src/curve/easing.rs b/crates/bevy_math/src/curve/easing.rs
--- a/crates/bevy_math/src/curve/easing.rs
+++ b/crates/bevy_math/src/curve/easing.rs
@@ -459,3 +475,83 @@ impl EaseFunction {
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ const MONOTONIC_IN_OUT_INOUT: &[[EaseFunction; 3]] = {
+ use EaseFunction::*;
+ &[
+ [QuadraticIn, QuadraticOut, QuadraticInOut],
+ [CubicIn, CubicOut, CubicInOut],
+ [QuarticIn, QuarticOut, QuarticInOut],
+ [QuinticIn, QuinticOut, QuinticInOut],
+ [SineIn, SineOut, SineInOut],
+ [CircularIn, CircularOut, CircularInOut],
+ [ExponentialIn, ExponentialOut, ExponentialInOut],
+ ]
+ };
+
+ // For easing function we don't care if eval(0) is super-tiny like 2.0e-28,
+ // so add the same amount of error on both ends of the unit interval.
+ const TOLERANCE: f32 = 1.0e-6;
+ const _: () = const {
+ assert!(1.0 - TOLERANCE != 1.0);
+ };
+
+ #[test]
+ fn ease_functions_zero_to_one() {
+ for ef in MONOTONIC_IN_OUT_INOUT.iter().flatten() {
+ let start = ef.eval(0.0);
+ assert!(
+ (0.0..=TOLERANCE).contains(&start),
+ "EaseFunction.{ef:?}(0) was {start:?}",
+ );
+
+ let finish = ef.eval(1.0);
+ assert!(
+ (1.0 - TOLERANCE..=1.0).contains(&finish),
+ "EaseFunction.{ef:?}(1) was {start:?}",
+ );
+ }
+ }
+
+ #[test]
+ fn ease_function_inout_deciles() {
+ // convexity gives these built-in tolerances
+ for [_, _, ef_inout] in MONOTONIC_IN_OUT_INOUT {
+ for x in [0.1, 0.2, 0.3, 0.4] {
+ let y = ef_inout.eval(x);
+ assert!(y < x, "EaseFunction.{ef_inout:?}({x:?}) was {y:?}");
+ }
+
+ for x in [0.6, 0.7, 0.8, 0.9] {
+ let y = ef_inout.eval(x);
+ assert!(y > x, "EaseFunction.{ef_inout:?}({x:?}) was {y:?}");
+ }
+ }
+ }
+
+ #[test]
+ fn ease_function_midpoints() {
+ for [ef_in, ef_out, ef_inout] in MONOTONIC_IN_OUT_INOUT {
+ let mid = ef_in.eval(0.5);
+ assert!(
+ mid < 0.5 - TOLERANCE,
+ "EaseFunction.{ef_in:?}(½) was {mid:?}",
+ );
+
+ let mid = ef_out.eval(0.5);
+ assert!(
+ mid > 0.5 + TOLERANCE,
+ "EaseFunction.{ef_out:?}(½) was {mid:?}",
+ );
+
+ let mid = ef_inout.eval(0.5);
+ assert!(
+ (0.5 - TOLERANCE..=0.5 + TOLERANCE).contains(&mid),
+ "EaseFunction.{ef_inout:?}(½) was {mid:?}",
+ );
+ }
+ }
+}
|
`EaseFunction::ExponentialIn` jumps at the beginning
## Bevy version
2024-12-05 https://github.com/bevyengine/bevy/commit/bc572cd27
## What you did
Called `ExponentialIn.eval(0)`, expecting it to be essentially 0, but it returned about 1‰ instead.
See tests in https://github.com/bevyengine/bevy/pull/16675/files#diff-91e5390dd7a24ce92750ba40df5ef8d7a2466401ef7d3e50eb3d8861b8bc52d6R486-R501
```
EaseFunction.ExponentialIn(0) was 0.0009765625
```
## Additional information
It's only the `Exponential*` functions that fail these tests; the rest of them all pass.
TBH, the definition feels very arbitrary to me in comparison to the other things:
https://github.com/bevyengine/bevy/blob/72f096c91ea1056c41f2da821d310765c4482c00/crates/bevy_math/src/curve/easing.rs#L327-L330
Why `10`, for example?
It makes me wonder if it should be something more like <https://en.wikipedia.org/wiki/Non-analytic_smooth_function#Smooth_transition_functions> instead.
|
2024-12-20T07:30:51Z
|
1.83
|
2024-12-24T03:01:12Z
|
64efd08e13c55598587f3071070f750f8945e28e
|
[
"curve::easing::tests::ease_functions_zero_to_one"
] |
[
"bounding::bounded2d::aabb2d_tests::area",
"bounding::bounded2d::aabb2d_tests::center",
"bounding::bounded2d::aabb2d_tests::closest_point",
"bounding::bounded2d::aabb2d_tests::contains",
"bounding::bounded2d::aabb2d_tests::grow",
"bounding::bounded2d::aabb2d_tests::half_size",
"bounding::bounded2d::aabb2d_tests::intersect_aabb",
"bounding::bounded2d::aabb2d_tests::intersect_bounding_circle",
"bounding::bounded2d::aabb2d_tests::merge",
"bounding::bounded2d::aabb2d_tests::scale_around_center",
"bounding::bounded2d::aabb2d_tests::shrink",
"bounding::bounded2d::aabb2d_tests::transform",
"bounding::bounded2d::bounding_circle_tests::area",
"bounding::bounded2d::bounding_circle_tests::closest_point",
"bounding::bounded2d::bounding_circle_tests::contains",
"bounding::bounded2d::bounding_circle_tests::contains_identical",
"bounding::bounded2d::bounding_circle_tests::grow",
"bounding::bounded2d::bounding_circle_tests::intersect_bounding_circle",
"bounding::bounded2d::bounding_circle_tests::merge",
"bounding::bounded2d::bounding_circle_tests::merge_identical",
"bounding::bounded2d::bounding_circle_tests::scale_around_center",
"bounding::bounded2d::bounding_circle_tests::shrink",
"bounding::bounded2d::bounding_circle_tests::transform",
"bounding::bounded2d::primitive_impls::tests::acute_triangle",
"bounding::bounded2d::primitive_impls::tests::annulus",
"bounding::bounded2d::primitive_impls::tests::capsule",
"bounding::bounded2d::primitive_impls::tests::circle",
"bounding::bounded2d::primitive_impls::tests::arc_and_segment",
"bounding::bounded2d::primitive_impls::tests::circular_sector",
"bounding::bounded2d::primitive_impls::tests::ellipse",
"bounding::bounded2d::primitive_impls::tests::line",
"bounding::bounded2d::primitive_impls::tests::obtuse_triangle",
"bounding::bounded2d::primitive_impls::tests::plane",
"bounding::bounded2d::primitive_impls::tests::polygon",
"bounding::bounded2d::primitive_impls::tests::polyline",
"bounding::bounded2d::primitive_impls::tests::rectangle",
"bounding::bounded2d::primitive_impls::tests::regular_polygon",
"bounding::bounded2d::primitive_impls::tests::rhombus",
"bounding::bounded2d::primitive_impls::tests::segment",
"bounding::bounded3d::aabb3d_tests::area",
"bounding::bounded3d::aabb3d_tests::center",
"bounding::bounded3d::aabb3d_tests::closest_point",
"bounding::bounded3d::aabb3d_tests::contains",
"bounding::bounded3d::aabb3d_tests::grow",
"bounding::bounded3d::aabb3d_tests::half_size",
"bounding::bounded3d::aabb3d_tests::intersect_aabb",
"bounding::bounded3d::aabb3d_tests::intersect_bounding_sphere",
"bounding::bounded3d::aabb3d_tests::merge",
"bounding::bounded3d::aabb3d_tests::scale_around_center",
"bounding::bounded3d::aabb3d_tests::shrink",
"bounding::bounded3d::aabb3d_tests::transform",
"bounding::bounded3d::bounding_sphere_tests::area",
"bounding::bounded3d::bounding_sphere_tests::closest_point",
"bounding::bounded3d::bounding_sphere_tests::contains",
"bounding::bounded3d::bounding_sphere_tests::contains_identical",
"bounding::bounded3d::bounding_sphere_tests::grow",
"bounding::bounded3d::bounding_sphere_tests::intersect_bounding_sphere",
"bounding::bounded3d::bounding_sphere_tests::merge",
"bounding::bounded3d::bounding_sphere_tests::scale_around_center",
"bounding::bounded3d::bounding_sphere_tests::merge_identical",
"bounding::bounded3d::bounding_sphere_tests::shrink",
"bounding::bounded3d::bounding_sphere_tests::transform",
"bounding::bounded3d::extrusion::tests::capsule",
"bounding::bounded3d::extrusion::tests::circle",
"bounding::bounded3d::extrusion::tests::ellipse",
"bounding::bounded3d::extrusion::tests::line",
"bounding::bounded3d::extrusion::tests::polygon",
"bounding::bounded3d::extrusion::tests::polyline",
"bounding::bounded3d::extrusion::tests::rectangle",
"bounding::bounded3d::extrusion::tests::segment",
"bounding::bounded3d::extrusion::tests::regular_polygon",
"bounding::bounded3d::extrusion::tests::triangle",
"bounding::bounded3d::primitive_impls::tests::capsule",
"bounding::bounded3d::primitive_impls::tests::cone",
"bounding::bounded3d::primitive_impls::tests::conical_frustum",
"bounding::bounded3d::primitive_impls::tests::cuboid",
"bounding::bounded3d::primitive_impls::tests::cylinder",
"bounding::bounded3d::primitive_impls::tests::line",
"bounding::bounded3d::primitive_impls::tests::plane",
"bounding::bounded3d::primitive_impls::tests::polyline",
"bounding::bounded3d::primitive_impls::tests::segment",
"bounding::bounded3d::primitive_impls::tests::sphere",
"bounding::bounded3d::primitive_impls::tests::torus",
"bounding::bounded3d::primitive_impls::tests::triangle3d",
"bounding::bounded3d::primitive_impls::tests::wide_conical_frustum",
"bounding::raycast2d::tests::test_aabb_cast_hits",
"bounding::raycast2d::tests::test_circle_cast_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_hits",
"bounding::raycast2d::tests::test_ray_intersection_aabb_inside",
"bounding::raycast2d::tests::test_ray_intersection_aabb_misses",
"bounding::raycast2d::tests::test_ray_intersection_circle_hits",
"bounding::raycast2d::tests::test_ray_intersection_circle_inside",
"bounding::raycast2d::tests::test_ray_intersection_circle_misses",
"bounding::raycast3d::tests::test_aabb_cast_hits",
"bounding::raycast3d::tests::test_ray_intersection_aabb_hits",
"bounding::raycast3d::tests::test_ray_intersection_aabb_misses",
"bounding::raycast3d::tests::test_ray_intersection_aabb_inside",
"bounding::raycast3d::tests::test_ray_intersection_sphere_hits",
"bounding::raycast3d::tests::test_ray_intersection_sphere_misses",
"bounding::raycast3d::tests::test_ray_intersection_sphere_inside",
"bounding::raycast3d::tests::test_sphere_cast_hits",
"compass::test_compass_octant::test_cardinal_directions",
"compass::test_compass_octant::test_east_pie_slice",
"compass::test_compass_octant::test_north_east_pie_slice",
"compass::test_compass_octant::test_north_pie_slice",
"compass::test_compass_octant::test_north_west_pie_slice",
"compass::test_compass_octant::test_south_east_pie_slice",
"compass::test_compass_octant::test_south_pie_slice",
"compass::test_compass_octant::test_south_west_pie_slice",
"compass::test_compass_octant::test_west_pie_slice",
"compass::test_compass_quadrant::test_cardinal_directions",
"compass::test_compass_quadrant::test_east_pie_slice",
"compass::test_compass_quadrant::test_north_pie_slice",
"compass::test_compass_quadrant::test_south_pie_slice",
"compass::test_compass_quadrant::test_west_pie_slice",
"cubic_splines::tests::cardinal_control_pts",
"cubic_splines::tests::cubic_to_rational",
"cubic_splines::tests::easing_simple",
"cubic_splines::tests::easing_overshoot",
"cubic_splines::tests::easing_undershoot",
"cubic_splines::tests::nurbs_circular_arc",
"curve::cores::tests::chunked_uneven_sample_interp",
"curve::cores::tests::uneven_sample_interp",
"cubic_splines::tests::cubic",
"curve::derivatives::adaptor_impls::tests::continuation_curve",
"curve::derivatives::adaptor_impls::tests::constant_curve",
"curve::derivatives::adaptor_impls::tests::forever_curve",
"curve::cores::tests::even_sample_interp",
"curve::derivatives::adaptor_impls::tests::chain_curve",
"curve::derivatives::adaptor_impls::tests::curve_reparam_curve",
"curve::derivatives::adaptor_impls::tests::graph_curve",
"curve::derivatives::adaptor_impls::tests::reverse_curve",
"curve::derivatives::adaptor_impls::tests::zip_curve",
"curve::derivatives::adaptor_impls::tests::ping_pong_curve",
"curve::derivatives::adaptor_impls::tests::repeat_curve",
"curve::easing::tests::ease_function_inout_deciles",
"curve::easing::tests::ease_function_midpoints",
"curve::derivatives::adaptor_impls::tests::linear_reparam_curve",
"curve::interval::tests::containment",
"curve::interval::tests::intersections",
"curve::interval::tests::interval_containment",
"curve::interval::tests::boundedness",
"curve::interval::tests::linear_maps",
"curve::interval::tests::lengths",
"curve::interval::tests::make_intervals",
"curve::sample_curves::tests::reflect_sample_curve",
"curve::sample_curves::tests::reflect_uneven_sample_curve",
"curve::tests::constant_curves",
"curve::tests::curve_can_be_made_into_an_object",
"curve::tests::continue_chain",
"curve::tests::easing_curves_quadratic",
"curve::tests::easing_curves_step",
"curve::tests::function_curves",
"curve::tests::linear_curve",
"curve::tests::mapping",
"curve::tests::multiple_maps",
"curve::tests::multiple_reparams",
"curve::tests::ping_pong",
"curve::tests::reparameterization",
"curve::tests::repeat",
"curve::tests::reverse",
"curve::tests::sample_iterators",
"direction::tests::dir2_creation",
"direction::tests::dir2_renorm",
"direction::tests::dir2_slerp",
"curve::tests::uneven_resampling",
"direction::tests::dir2_to_rotation2d",
"direction::tests::dir3_creation",
"direction::tests::dir3_slerp",
"direction::tests::dir3_renorm",
"curve::interval::tests::spaced_points",
"curve::tests::resampling",
"direction::tests::dir3a_creation",
"direction::tests::dir3a_renorm",
"direction::tests::dir3a_slerp",
"float_ord::tests::float_ord_cmp",
"float_ord::tests::float_ord_cmp_operators",
"float_ord::tests::float_ord_eq",
"float_ord::tests::float_ord_hash",
"isometry::tests::identity_2d",
"isometry::tests::identity_3d",
"isometry::tests::inverse_2d",
"isometry::tests::inverse_3d",
"isometry::tests::inverse_mul_2d",
"isometry::tests::inverse_mul_3d",
"isometry::tests::inverse_transform_2d",
"isometry::tests::inverse_transform_3d",
"isometry::tests::mul_2d",
"isometry::tests::mul_3d",
"isometry::tests::transform_2d",
"isometry::tests::transform_3d",
"primitives::dim2::arc_tests::full_circle",
"primitives::dim2::arc_tests::half_circle",
"primitives::dim2::arc_tests::quarter_circle",
"primitives::dim2::arc_tests::zero_angle",
"primitives::dim2::arc_tests::zero_radius",
"primitives::dim2::tests::annulus_closest_point",
"primitives::dim2::tests::annulus_math",
"primitives::dim2::tests::capsule_math",
"primitives::dim2::tests::circle_closest_point",
"primitives::dim2::tests::circle_math",
"primitives::dim2::tests::ellipse_math",
"primitives::dim2::tests::ellipse_perimeter",
"primitives::dim2::tests::rectangle_closest_point",
"primitives::dim2::tests::rectangle_math",
"primitives::dim2::tests::regular_polygon_math",
"primitives::dim2::tests::regular_polygon_vertices",
"primitives::dim2::tests::rhombus_closest_point",
"primitives::dim2::tests::rhombus_math",
"primitives::dim2::tests::triangle_circumcenter",
"primitives::dim2::tests::triangle_math",
"primitives::dim2::tests::triangle_winding_order",
"primitives::dim3::tests::capsule_math",
"primitives::dim3::tests::cone_math",
"primitives::dim3::tests::cuboid_closest_point",
"primitives::dim3::tests::cuboid_math",
"primitives::dim3::tests::cylinder_math",
"primitives::dim3::tests::direction_creation",
"primitives::dim3::tests::extrusion_math",
"primitives::dim3::tests::infinite_plane_math",
"primitives::dim3::tests::plane_from_points",
"primitives::dim3::tests::sphere_closest_point",
"primitives::dim3::tests::sphere_math",
"primitives::dim3::tests::tetrahedron_math",
"primitives::dim3::tests::torus_math",
"primitives::dim3::tests::triangle_math",
"ray::tests::intersect_plane_2d",
"primitives::polygon::tests::complex_polygon",
"primitives::polygon::tests::simple_polygon",
"ray::tests::intersect_plane_3d",
"rects::irect::tests::rect_inflate",
"rects::irect::tests::rect_intersect",
"rects::irect::tests::rect_union",
"rects::irect::tests::rect_union_pt",
"rects::irect::tests::well_formed",
"rects::rect::tests::rect_inflate",
"rects::rect::tests::rect_intersect",
"rects::rect::tests::rect_union",
"rects::rect::tests::rect_union_pt",
"rects::rect::tests::well_formed",
"rects::urect::tests::rect_inflate",
"rects::urect::tests::rect_intersect",
"rects::urect::tests::rect_union",
"rects::urect::tests::rect_union_pt",
"rects::urect::tests::well_formed",
"rotation2d::tests::add",
"rotation2d::tests::creation",
"rotation2d::tests::fast_renormalize",
"rotation2d::tests::is_near_identity",
"rotation2d::tests::length",
"rotation2d::tests::nlerp",
"rotation2d::tests::normalize",
"rotation2d::tests::rotate",
"rotation2d::tests::rotation_range",
"rotation2d::tests::slerp",
"rotation2d::tests::subtract",
"rotation2d::tests::try_normalize",
"sampling::shape_sampling::tests::circle_boundary_sampling",
"sampling::shape_sampling::tests::circle_interior_sampling",
"crates/bevy_math/src/curve/mod.rs - curve::Curve::reparametrize (line 422)",
"crates/bevy_math/src/curve/mod.rs - curve (line 153)",
"crates/bevy_math/src/curve/mod.rs - curve (line 96)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::contains (line 231)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::is_empty (line 139)",
"crates/bevy_math/src/curve/mod.rs - curve (line 126)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::new (line 52)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::height (line 167)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::contains (line 228)",
"crates/bevy_math/src/curve/mod.rs - curve (line 141)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::width (line 153)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::union (line 237)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::new (line 52)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_corners (line 69)",
"crates/bevy_math/src/curve/cores.rs - curve::cores::UnevenCore (line 269)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::height (line 164)",
"crates/bevy_math/src/curve/mod.rs - curve (line 55)",
"crates/bevy_math/src/curve/mod.rs - curve (line 176)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::contains (line 219)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_center_size (line 92)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::is_empty (line 135)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::height (line 163)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::intersect (line 283)",
"crates/bevy_math/src/common_traits.rs - common_traits::StableInterpolate::smooth_nudge (line 333)",
"crates/bevy_math/src/curve/cores.rs - curve::cores::EvenCore (line 69)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry2d (line 28)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::union_point (line 260)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_corners (line 69)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_corners (line 69)",
"crates/bevy_math/src/curve/mod.rs - curve::Curve::reparametrize (line 431)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry2d (line 36)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::half_size (line 191)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::center (line 205)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::inflate (line 311)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::width (line 149)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::from_center_half_size (line 113)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::size (line 177)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::is_empty (line 136)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::new (line 52)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::width (line 150)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rot2::nlerp (line 385)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling (line 5)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling::ShapeSample::sample_interior (line 59)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling::ShapeSample::sample_boundary (line 73)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling::ShapeSample::boundary_dist (line 109)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling::ShapeSample::interior_dist (line 87)",
"crates/bevy_math/src/curve/mod.rs - curve::Curve::resample (line 719)",
"crates/bevy_math/src/curve/mod.rs - curve::Curve::by_ref (line 875)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry3d (line 320)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry3d (line 337)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_center_size (line 96)",
"crates/bevy_math/src/direction.rs - direction::Dir3::fast_renormalize (line 491)",
"crates/bevy_math/src/curve/mod.rs - curve (line 198)",
"crates/bevy_math/src/cubic_splines/mod.rs - cubic_splines::CubicSegment<Vec2>::ease (line 1045)",
"crates/bevy_math/src/curve/mod.rs - curve (line 251)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry2d (line 45)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry2d (line 74)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::size (line 178)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::union_point (line 269)",
"crates/bevy_math/src/cubic_splines/mod.rs - cubic_splines::CubicBSpline (line 430)",
"crates/bevy_math/src/sampling/mesh_sampling.rs - sampling::mesh_sampling::UniformMeshSampler (line 19)",
"crates/bevy_math/src/rects/rect.rs - rects::rect::Rect::normalize (line 340)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_center_size (line 96)",
"crates/bevy_math/src/cubic_splines/mod.rs - cubic_splines::CubicNurbs (line 604)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry3d (line 351)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::inflate (line 323)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::half_size (line 199)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::union (line 249)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rot2::turn_fraction (line 162)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::from_center_half_size (line 117)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::union_point (line 272)",
"crates/bevy_math/src/direction.rs - direction::Dir2::slerp (line 203)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry2d (line 61)",
"crates/bevy_math/src/direction.rs - direction::Dir3A::slerp (line 721)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry3d (line 310)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rot2::degrees (line 138)",
"crates/bevy_math/src/sampling/standard.rs - sampling::standard::FromRng (line 39)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::center (line 217)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::intersect (line 292)",
"crates/bevy_math/src/direction.rs - direction::Dir3::fast_renormalize (line 501)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::inflate (line 320)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rot2 (line 19)",
"crates/bevy_math/src/curve/mod.rs - curve (line 71)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::union (line 246)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::size (line 181)",
"crates/bevy_math/src/cubic_splines/mod.rs - cubic_splines::CubicCardinalSpline (line 268)",
"crates/bevy_math/src/rects/irect.rs - rects::irect::IRect::intersect (line 295)",
"crates/bevy_math/src/cubic_splines/mod.rs - cubic_splines::CubicHermite (line 133)",
"crates/bevy_math/src/isometry.rs - isometry::Isometry3d (line 301)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::from_center_half_size (line 117)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::half_size (line 196)",
"crates/bevy_math/src/direction.rs - direction::Dir3::slerp (line 462)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rot2::slerp (line 423)",
"crates/bevy_math/src/sampling/shape_sampling.rs - sampling::shape_sampling (line 21)",
"crates/bevy_math/src/primitives/dim3.rs - primitives::dim3::InfinitePlane3d::isometries_xy (line 312)",
"crates/bevy_math/src/curve/mod.rs - curve (line 220)",
"crates/bevy_math/src/cubic_splines/mod.rs - cubic_splines::CubicBezier (line 41)",
"crates/bevy_math/src/rotation2d.rs - rotation2d::Rot2::radians (line 112)",
"crates/bevy_math/src/rects/urect.rs - rects::urect::URect::center (line 214)",
"crates/bevy_math/src/sampling/standard.rs - sampling::standard (line 7)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 16,747
|
bevyengine__bevy-16747
|
[
"16736"
] |
bb090e61766a7e4c09d14e28abc16829d7b60368
|
diff --git a/crates/bevy_animation/src/animation_curves.rs b/crates/bevy_animation/src/animation_curves.rs
--- a/crates/bevy_animation/src/animation_curves.rs
+++ b/crates/bevy_animation/src/animation_curves.rs
@@ -243,18 +243,26 @@ where
impl<C: Typed, P, F: Fn(&mut C) -> &mut P + 'static> AnimatedField<C, P, F> {
/// Creates a new instance of [`AnimatedField`]. This operates under the assumption that
- /// `C` is a reflect-able struct with named fields, and that `field_name` is a valid field on that struct.
+ /// `C` is a reflect-able struct, and that `field_name` is a valid field on that struct.
///
/// # Panics
- /// If the type of `C` is not a struct with named fields or if the `field_name` does not exist.
+ /// If the type of `C` is not a struct or if the `field_name` does not exist.
pub fn new_unchecked(field_name: &str, func: F) -> Self {
- let TypeInfo::Struct(struct_info) = C::type_info() else {
+ let field_index;
+ if let TypeInfo::Struct(struct_info) = C::type_info() {
+ field_index = struct_info
+ .index_of(field_name)
+ .expect("Field name should exist");
+ } else if let TypeInfo::TupleStruct(struct_info) = C::type_info() {
+ field_index = field_name
+ .parse()
+ .expect("Field name should be a valid tuple index");
+ if field_index >= struct_info.field_len() {
+ panic!("Field name should be a valid tuple index");
+ }
+ } else {
panic!("Only structs are supported in `AnimatedField::new_unchecked`")
- };
-
- let field_index = struct_info
- .index_of(field_name)
- .expect("Field name should exist");
+ }
Self {
func,
|
diff --git a/crates/bevy_animation/src/animation_curves.rs b/crates/bevy_animation/src/animation_curves.rs
--- a/crates/bevy_animation/src/animation_curves.rs
+++ b/crates/bevy_animation/src/animation_curves.rs
@@ -984,3 +992,21 @@ macro_rules! animated_field {
})
};
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_animated_field_tuple_struct_simple_uses() {
+ #[derive(Clone, Debug, Component, Reflect)]
+ struct A(f32);
+ let _ = AnimatedField::new_unchecked("0", |a: &mut A| &mut a.0);
+
+ #[derive(Clone, Debug, Component, Reflect)]
+ struct B(f32, f64, f32);
+ let _ = AnimatedField::new_unchecked("0", |b: &mut B| &mut b.0);
+ let _ = AnimatedField::new_unchecked("1", |b: &mut B| &mut b.1);
+ let _ = AnimatedField::new_unchecked("2", |b: &mut B| &mut b.2);
+ }
+}
|
Add support to the `animated_field!` macro for tuple structs
## What problem does this solve or what need does it fill?
Components like `TextColor` and `BackgroundColor` cannot currently be easily animated without creating a custom `AnimatableProperty`.
## What solution would you like?
Add support to the `animated_field!` macro (and consequently `AnimatedField`) for tuple structs. I'm not sure what the cleanest way to do this is from an implementation perspective, since the `$ident` pattern doesn't match tuple struct field indices and I'm not sure if it makes sense to use `$literal`, as that matches more than just field indices.
## What alternative(s) have you considered?
- Add an alternative easy way to animate tuple structs (e.g. a separate macro/type)
- Maybe something could be done with `Deref` and a blanket implementation of `AnimatableProperty`? But this puts the burden on components to implement `Deref`, only works for tuple structs with single fields, and also introduces potential conflicts with trait implementations because it would be a blanket implementation
## Additional context
I was specifically trying to animate UI color alpha when I ran into this, and I wonder if it's worth considering if there should be easy ways to get a `&mut` to a `Color`'s alpha and also possibly animate individual fields of a component's fields (e.g. animating `Transform::translation::x`), but that's a separate issue and probably a little more complicated.
|
Can you use `_0` and so on? That's the field name of tuple structs.
`_0` and friends don't seem to work with the macro, Rust complains about incorrect field names because the macro does field access via the provided field name.
You can try to construct an `AnimatedField` directly (the below compiles):
```rust
#[derive(Clone, Debug, Component, Reflect)]
struct MyTupleStruct(f32);
let mut clip = AnimationClip::default();
clip.add_curve_to_target(
AnimationTargetId::from_name(&Name::new("target")),
AnimatableCurve::new(
AnimatedField::new_unchecked(
"_0",
|my_tuple_struct: &mut MyTupleStruct| &mut my_tuple_struct.0
),
EasingCurve::new(0., 1., EaseFunction::Linear),
)
);
```
...but running it panics because `AnimatedField` only supports non-tuple structs. I could probably draft a PR to make it possible to manually construct an `AnimatedField` (it seems like a trivial fix, just check for tuple structs as well), but I'm not as sure what the "correct" way to change the macro would be, or if changing `AnimatedField` would be useful without also fixing the macro.
Let's start with that and get more feedback in review.
|
2024-12-10T13:25:48Z
|
1.82
|
2024-12-12T04:00:23Z
|
6178ce93e8537f823685e8c1b617e22ba93696e7
|
[
"animation_curves::tests::test_animated_field_tuple_struct_simple_uses"
] |
[
"tests::test_events_triggers",
"tests::test_events_triggers_looping",
"tests::test_multiple_events_triggers",
"crates/bevy_animation/src/animation_curves.rs - animation_curves (line 10)",
"crates/bevy_animation/src/animation_curves.rs - animation_curves::AnimatableProperty (line 117)",
"crates/bevy_animation/src/animation_curves.rs - animation_curves (line 28)",
"crates/bevy_animation/src/lib.rs - AnimationClip::add_event_fn_to_target (line 396)",
"crates/bevy_animation/src/animation_curves.rs - animation_curves (line 41)",
"crates/bevy_animation/src/lib.rs - AnimationClip::add_event_fn (line 373)",
"crates/bevy_animation/src/animation_curves.rs - animation_curves::AnimatableProperty (line 145)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 16,499
|
bevyengine__bevy-16499
|
[
"16498"
] |
0070514f5468909ffa50845bca2a665766edfe9d
|
diff --git a/crates/bevy_ecs/src/bundle.rs b/crates/bevy_ecs/src/bundle.rs
--- a/crates/bevy_ecs/src/bundle.rs
+++ b/crates/bevy_ecs/src/bundle.rs
@@ -902,7 +902,6 @@ impl<'w> BundleInserter<'w> {
let mut deferred_world = self.world.into_deferred();
if insert_mode == InsertMode::Replace {
- deferred_world.trigger_on_replace(archetype, entity, add_bundle.iter_existing());
if archetype.has_replace_observer() {
deferred_world.trigger_observers(
ON_REPLACE,
diff --git a/crates/bevy_ecs/src/bundle.rs b/crates/bevy_ecs/src/bundle.rs
--- a/crates/bevy_ecs/src/bundle.rs
+++ b/crates/bevy_ecs/src/bundle.rs
@@ -910,6 +909,7 @@ impl<'w> BundleInserter<'w> {
add_bundle.iter_existing(),
);
}
+ deferred_world.trigger_on_replace(archetype, entity, add_bundle.iter_existing());
}
}
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -1863,14 +1863,14 @@ impl<'w> EntityWorldMut<'w> {
// SAFETY: All components in the archetype exist in world
unsafe {
- deferred_world.trigger_on_replace(archetype, self.entity, archetype.components());
if archetype.has_replace_observer() {
deferred_world.trigger_observers(ON_REPLACE, self.entity, archetype.components());
}
- deferred_world.trigger_on_remove(archetype, self.entity, archetype.components());
+ deferred_world.trigger_on_replace(archetype, self.entity, archetype.components());
if archetype.has_remove_observer() {
deferred_world.trigger_observers(ON_REMOVE, self.entity, archetype.components());
}
+ deferred_world.trigger_on_remove(archetype, self.entity, archetype.components());
}
for component_id in archetype.components() {
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -2118,7 +2118,6 @@ unsafe fn trigger_on_replace_and_on_remove_hooks_and_observers(
entity: Entity,
bundle_info: &BundleInfo,
) {
- deferred_world.trigger_on_replace(archetype, entity, bundle_info.iter_explicit_components());
if archetype.has_replace_observer() {
deferred_world.trigger_observers(
ON_REPLACE,
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -2126,10 +2125,11 @@ unsafe fn trigger_on_replace_and_on_remove_hooks_and_observers(
bundle_info.iter_explicit_components(),
);
}
- deferred_world.trigger_on_remove(archetype, entity, bundle_info.iter_explicit_components());
+ deferred_world.trigger_on_replace(archetype, entity, bundle_info.iter_explicit_components());
if archetype.has_remove_observer() {
deferred_world.trigger_observers(ON_REMOVE, entity, bundle_info.iter_explicit_components());
}
+ deferred_world.trigger_on_remove(archetype, entity, bundle_info.iter_explicit_components());
}
const QUERY_MISMATCH_ERROR: &str = "Query does not match the current entity";
|
diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs
--- a/crates/bevy_ecs/src/world/entity_ref.rs
+++ b/crates/bevy_ecs/src/world/entity_ref.rs
@@ -4910,14 +4910,14 @@ mod tests {
"OrdB hook on_insert",
"OrdB observer on_insert",
"OrdB command on_add", // command added by OrdB hook on_add, needs to run before despawn command
- "OrdA hook on_replace", // start of despawn
- "OrdB hook on_replace",
- "OrdA observer on_replace",
+ "OrdA observer on_replace", // start of despawn
"OrdB observer on_replace",
- "OrdA hook on_remove",
- "OrdB hook on_remove",
+ "OrdA hook on_replace",
+ "OrdB hook on_replace",
"OrdA observer on_remove",
"OrdB observer on_remove",
+ "OrdA hook on_remove",
+ "OrdB hook on_remove",
];
world.flush();
assert_eq!(world.resource_mut::<TestVec>().0.as_slice(), &expected[..]);
|
Hook and observer ordering for `on_remove`/`on_replace` should be inverted
## Bevy version
0.15.0-rc.3 (exists before as well)
## What you did
When adding a component, the order of hooks and observers are:
- on_add hook
- on_add observers
- on_insert hook
- on_insert observers
When removing a component, the order of hooks and observers are:
- on_replace hook
- on_replace observers
- on_remove hook
- on_remove observers
## What went wrong
The remove ordering matches the add ordering, while it would be more natural for it to be inverted – running observers before hooks, that is.
## Additional information
Note that this bug is to provoke **discussion**. The current behaviour may be considered correct as well. So this bug should be used to discuss the matter and make a decision so that the decision is then documented for posterity.
|
[Flecs also runs `on_remove` hooks after `OnRemove` observers](https://www.flecs.dev/flecs/md_docs_2ObserversManual.html#hooks-and-events)
|
2024-11-25T00:48:00Z
|
1.82
|
2024-12-06T00:45:03Z
|
6178ce93e8537f823685e8c1b617e22ba93696e7
|
[
"world::entity_ref::tests::command_ordering_is_correct"
] |
[
"bundle::tests::component_hook_order_spawn_despawn",
"bundle::tests::component_hook_order_replace",
"bundle::tests::component_hook_order_insert_remove",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"bundle::tests::insert_if_new",
"change_detection::tests::as_deref_mut",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_res_mut",
"bundle::tests::component_hook_order_recursive",
"bundle::tests::component_hook_order_recursive_multiple",
"change_detection::tests::mut_new",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::change_tick_scan",
"change_detection::tests::change_expiration",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::set_if_neq",
"entity::clone_entities::tests::clone_entity_using_clone",
"entity::clone_entities::tests::clone_entity_with_allow_filter",
"entity::map_entities::tests::entity_mapper",
"entity::clone_entities::tests::clone_entity_with_override_bundle",
"entity::clone_entities::tests::clone_entity_with_deny_filter",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::map_entities::tests::entity_mapper_no_panic",
"entity::clone_entities::tests::clone_entity_specialization",
"entity::tests::entity_comparison",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_const",
"entity::clone_entities::tests::clone_entity_with_override_allow_filter",
"entity::tests::entity_debug",
"entity::clone_entities::tests::clone_entity_using_reflect",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"event::tests::test_event_cursor_clear",
"entity::visit_entities::tests::visit_entities",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_cursor_iter_len_updated",
"event::tests::test_event_cursor_len_current",
"event::tests::test_event_cursor_len_empty",
"event::tests::test_event_cursor_len_filled",
"event::tests::test_event_cursor_len_update",
"event::tests::test_event_cursor_read",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_event_reader_iter_last",
"event::tests::test_events",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_events_send_default",
"event::tests::test_events_update_drain",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::from_bits",
"identifier::tests::id_comparison",
"identifier::tests::id_construction",
"intern::tests::different_interned_content",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"intern::tests::zero_sized_type",
"label::tests::dyn_eq_object_safe",
"label::tests::dyn_hash_object_safe",
"observer::tests::observer_invalid_params",
"observer::tests::observer_dynamic_trigger",
"observer::entity_observer::tests::clone_entity_with_observer",
"observer::tests::observer_apply_deferred_from_param_set",
"observer::tests::observer_despawn",
"observer::tests::observer_multiple_listeners",
"observer::tests::observer_multiple_events",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::read_all_access_conflicts",
"query::access::tests::filtered_combined_access",
"observer::tests::observer_multiple_matches",
"query::access::tests::access_get_conflicts",
"observer::tests::observer_dynamic_component",
"query::access::tests::test_access_clone_from",
"observer::tests::observer_propagating_world",
"query::access::tests::test_access_filters_clone",
"query::access::tests::filtered_access_extend",
"observer::tests::observer_trigger_ref",
"observer::tests::observer_multiple_components",
"observer::tests::observer_propagating_no_next",
"query::access::tests::test_access_filters_clone_from",
"query::access::tests::test_filtered_access_clone",
"observer::tests::observer_entity_routing",
"observer::tests::observer_order_spawn_despawn",
"observer::tests::observer_despawn_archetype_flags",
"query::access::tests::test_access_clone",
"query::access::tests::test_filtered_access_clone_from",
"observer::tests::observer_on_remove_during_despawn_spawn_empty",
"observer::tests::observer_order_insert_remove",
"observer::tests::observer_no_target",
"observer::tests::observer_propagating_world_skipping",
"observer::tests::observer_order_replace",
"observer::tests::observer_propagating",
"query::access::tests::test_filtered_access_set_from",
"observer::tests::observer_triggered_components",
"query::access::tests::test_filtered_access_set_clone",
"observer::tests::observer_order_recursive",
"observer::tests::observer_propagating_join",
"observer::tests::observer_propagating_halt",
"observer::tests::observer_propagating_parallel_propagation",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"observer::tests::observer_order_insert_remove_sparse",
"observer::tests::observer_trigger_targets_ref",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"query::builder::tests::builder_dynamic_components",
"query::builder::tests::builder_transmute",
"query::builder::tests::builder_or",
"query::builder::tests::builder_with_without_dynamic",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_metadata_collision",
"query::fetch::tests::world_query_phantom_data",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::builder::tests::builder_static_dense_dynamic_sparse",
"query::fetch::tests::world_query_struct_variants",
"query::error::test::query_does_not_match",
"query::iter::tests::query_iter_many_sorts",
"query::builder::tests::builder_static_components",
"query::state::tests::can_generalize_with_option",
"query::iter::tests::query_iter_sorts",
"query::iter::tests::empty_query_iter_sort_after_next_does_not_panic",
"query::builder::tests::builder_with_without_static",
"query::iter::tests::query_iter_many_sort_doesnt_panic_after_next",
"query::state::tests::can_transmute_added",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_changed",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::can_transmute_entity_mut",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::can_transmute_filtered_entity",
"query::state::tests::can_transmute_to_more_general",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::remove_reflected_bundle",
"reflect::entity_commands::tests::insert_reflect_bundle_with_registry",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::insert_reflect_bundle",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"schedule::graph::graph_map::tests::strongly_connected_components",
"query::tests::query",
"query::state::tests::transmute_from_sparse_to_dense",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"schedule::graph::graph_map::tests::node_order_preservation",
"schedule::condition::tests::distributive_run_if_compiles",
"query::state::tests::transmute_from_dense_to_sparse",
"query::state::tests::join",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::has_query",
"query::tests::many_entities",
"query::tests::query_iter_combinations",
"query::tests::query_iter_combinations_sparse",
"query::state::tests::join_with_get",
"reflect::entity_commands::tests::remove_reflected_bundle_with_registry",
"query::tests::multi_storage_query",
"query::tests::any_query",
"schedule::executor::simple::skip_automatic_sync_points",
"query::tests::query_filtered_iter_combinations",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::iter::tests::query_iter_sort_after_next - should panic",
"query::tests::derived_worldqueries",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::tests::self_conflicting_worldquery - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::transmute_with_different_world - should panic",
"query::iter::tests::query_iter_sort_after_next_dense - should panic",
"schedule::set::tests::test_derive_schedule_label",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get_many - should panic",
"schedule::set::tests::test_derive_system_set",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::stepping::tests::clear_breakpoint",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::stepping::tests::waiting_always_run",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::step_never_run",
"schedule::stepping::tests::unknown_schedule",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::stepping::tests::stepping_disabled",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::step_breakpoint",
"schedule::stepping::tests::step_always_run",
"schedule::stepping::tests::waiting_never_run",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::stepping::simple_executor",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::resources",
"schedule::stepping::tests::verify_cursor",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::system_ambiguity::write_component_and_entity_ref",
"schedule::tests::system_ambiguity::events",
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::nonsend",
"storage::sparse_set::tests::sparse_sets",
"storage::table::tests::table",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::resource_mut_and_entity_ref",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"system::builder::tests::filtered_resource_conflicts_read_with_res",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::one_of_everything",
"system::builder::tests::custom_param_builder",
"schedule::tests::system_ambiguity::resource_and_entity_mut",
"schedule::tests::system_ambiguity::shared_resource_mut_component",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::read_component_and_entity_mut",
"schedule::tests::system_ambiguity::correct_ambiguities",
"storage::blob_vec::tests::resize_test",
"schedule::tests::system_ambiguity::before_and_after",
"system::builder::tests::filtered_resource_mut_conflicts_read_with_res",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"system::builder::tests::dyn_builder",
"storage::sparse_set::tests::sparse_set",
"schedule::tests::system_ambiguity::read_world",
"system::builder::tests::multi_param_builder_inference",
"system::builder::tests::local_builder",
"system::builder::tests::multi_param_builder",
"system::builder::tests::query_builder",
"system::builder::tests::query_builder_state",
"system::builder::tests::filtered_resource_conflicts_read_with_resmut - should panic",
"system::builder::tests::filtered_resource_mut_conflicts_write_with_res - should panic",
"system::builder::tests::filtered_resource_mut_conflicts_read_with_resmut - should panic",
"system::builder::tests::filtered_resource_mut_conflicts_write_with_resmut - should panic",
"storage::blob_array::tests::make_sure_zst_components_get_dropped - should panic",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"system::builder::tests::filtered_resource_mut_conflicts_write_all_with_res - should panic",
"system::builder::tests::filtered_resource_conflicts_read_all_with_resmut - should panic",
"system::builder::tests::param_set_builder",
"system::builder::tests::param_set_vec_builder",
"system::commands::tests::entity_commands_entry",
"system::commands::tests::commands",
"system::builder::tests::vec_builder",
"system::commands::tests::insert_components",
"system::commands::tests::append",
"system::commands::tests::remove_component_with_required_components",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"system::commands::tests::test_commands_are_send_and_sync",
"system::commands::tests::remove_resources",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::executor::tests::invalid_condition_param_skips_system",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"schedule::tests::stepping::multi_threaded_executor",
"system::function_system::tests::into_system_type_id_consistency",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"system::system::tests::run_system_once",
"system::system::tests::run_two_systems",
"system::commands::tests::remove_components",
"system::system_name::tests::test_closure_system_name_regular_param",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"system::system_name::tests::test_system_name_regular_param",
"schedule::tests::conditions::systems_nested_in_system_sets",
"system::system_param::tests::system_param_const_generics",
"system::system_param::tests::system_param_flexibility",
"system::system_param::tests::system_param_generic_bounds",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::param_set_non_send_second",
"system::system_registry::tests::cached_system",
"system::system_param::tests::param_set_non_send_first",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::tests::system_execution::run_exclusive_system",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"system::system::tests::non_send_resources",
"schedule::tests::conditions::system_with_condition",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"system::system::tests::run_system_once_invalid_params",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"system::commands::tests::remove_components_by_id",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::schedule::tests::configure_set_on_new_schedule",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"system::system::tests::command_processing",
"event::tests::test_event_reader_iter_nth",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"system::system_param::tests::system_param_struct_variants",
"system::system_registry::tests::cached_system_commands",
"schedule::tests::conditions::multiple_conditions_on_system",
"system::system_registry::tests::change_detection",
"schedule::tests::conditions::systems_with_distributive_condition",
"system::system_registry::tests::exclusive_system",
"system::system_name::tests::test_system_name_exclusive_param",
"schedule::set::tests::test_schedule_label",
"system::system_registry::tests::input_values",
"schedule::tests::system_execution::run_system",
"system::system_registry::tests::local_variables",
"system::system_param::tests::system_param_field_limit",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::system_param::tests::non_sync_local",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"system::system_registry::tests::cached_system_adapters",
"schedule::condition::tests::multiple_run_conditions",
"system::system_registry::tests::output_values",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::executor::tests::invalid_system_param_skips",
"schedule::stepping::tests::step_run_if_false",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"system::system_registry::tests::system_with_input_ref",
"schedule::executor::multi_threaded::tests::check_spawn_exclusive_system_task_miri",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::schedule::tests::inserts_a_sync_point",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::run_system_invalid_params",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"system::system_registry::tests::system_with_input_mut",
"event::tests::test_event_mutator_iter_nth",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"schedule::tests::system_ambiguity::read_only",
"system::system_registry::tests::nested_systems_with_inputs",
"schedule::condition::tests::run_condition_combinators",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::get_system_conflicts",
"schedule::tests::system_ordering::order_systems",
"schedule::condition::tests::run_condition",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::tests::assert_systems",
"system::tests::any_of_with_empty_and_mut",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::any_of_and_without",
"system::tests::any_of_has_filter_with_when_both_have_it",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"system::tests::any_of_with_entity_and_mut",
"system::tests::any_of_working",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::tests::any_of_with_and_without_common",
"schedule::schedule::tests::no_sync_chain::chain_all",
"system::tests::immutable_mut_test",
"system::tests::long_life_test",
"system::tests::convert_mut_to_immut",
"system::tests::pipe_change_detection",
"system::tests::disjoint_query_mut_system",
"system::tests::commands_param_set",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::assert_world_and_entity_mut_system_does_conflict - should panic",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::assert_entity_mut_system_does_conflict - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::can_have_16_parameters",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::any_of_with_mut_and_ref - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::any_of_with_ref_and_mut - should panic",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::query_is_empty",
"event::tests::test_event_cursor_par_read",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::local_system",
"system::tests::nonconflicting_system_resources",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::non_send_system",
"system::tests::non_send_option_system",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_param_set_system",
"system::tests::assert_entity_ref_and_entity_mut_system_does_conflict - should panic",
"system::tests::simple_system",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::into_iter_impl",
"system::tests::or_has_filter_with",
"system::tests::system_state_archetype_update",
"system::tests::system_state_change_detection",
"system::tests::query_set_system",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::read_system_state",
"system::tests::query_validates_world_id - should panic",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::changed_resource_system",
"system::tests::panic_inside_system - should panic",
"system::tests::simple_fallible_system",
"system::tests::system_state_invalid_world - should panic",
"tests::changed_query",
"event::tests::test_event_cursor_par_read_mut",
"tests::added_tracking",
"tests::bundle_derive",
"system::tests::write_system_state",
"tests::despawn_mixed_storage",
"tests::added_queries",
"query::tests::par_iter_mut_change_detection",
"tests::changed_trackers",
"system::tests::update_archetype_component_access_works",
"tests::entity_ref_and_entity_ref_query_no_panic",
"tests::clear_entities",
"tests::dynamic_required_components",
"tests::empty_spawn",
"tests::filtered_query_access",
"system::tests::world_collections_system",
"system::tests::test_combinator_clone",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::duplicate_components_panic - should panic",
"tests::entity_ref_and_entity_mut_query_panic - should panic",
"tests::entity_mut_and_entity_mut_query_panic - should panic",
"tests::exact_size_query",
"tests::insert_batch_if_new",
"system::tests::removal_tracking",
"tests::changed_trackers_sparse",
"tests::generic_required_components",
"tests::add_remove_components",
"tests::insert_or_spawn_batch",
"tests::insert_batch_same_archetype",
"tests::insert_or_spawn_batch_invalid",
"tests::mut_and_mut_query_panic - should panic",
"tests::insert_batch",
"tests::insert_overwrite_drop",
"tests::mut_and_ref_query_panic - should panic",
"tests::insert_overwrite_drop_sparse",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::multiple_worlds_same_query_get - should panic",
"tests::non_send_resource_points_to_distinct_data",
"tests::despawn_table_storage",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::non_send_resource",
"tests::query_all",
"tests::query_all_for_each",
"tests::non_send_resource_panic - should panic",
"tests::par_for_each_dense",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::query_filter_with_sparse",
"tests::par_for_each_sparse",
"tests::query_filter_with_sparse_for_each",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_without",
"tests::query_missing_component",
"tests::query_get_works_across_sparse_removal",
"tests::query_get",
"tests::query_optional_component_sparse",
"tests::query_optional_component_sparse_no_match",
"tests::query_single_component",
"tests::query_optional_component_table",
"tests::query_single_component_for_each",
"tests::query_sparse_component",
"tests::random_access",
"tests::ref_and_mut_query_panic - should panic",
"tests::remove",
"tests::remove_bundle_and_his_required_components",
"tests::remove_missing",
"tests::remove_component_and_his_required_components",
"tests::remove_component_and_his_runtime_required_components",
"tests::required_components_insert_existing_hooks",
"tests::required_components",
"tests::remove_tracking",
"tests::required_components_retain_keeps_required",
"tests::required_components_spawn_then_insert_no_overwrite",
"tests::required_components_spawn_nonexistent_hooks",
"tests::reserve_and_spawn",
"tests::resource_scope",
"tests::required_components_take_leaves_required",
"tests::resource",
"tests::required_components_inheritance_depth",
"tests::runtime_required_components_existing_archetype",
"tests::runtime_required_components_fail_with_duplicate",
"tests::runtime_required_components",
"tests::runtime_required_components_deep_require_does_not_override_shallow_require",
"tests::runtime_required_components_deep_require_does_not_override_shallow_require_deep_subtree_after_shallow",
"tests::runtime_required_components_override_1",
"tests::runtime_required_components_override_2",
"tests::runtime_required_components_propagate_up",
"tests::runtime_required_components_propagate_up_even_more",
"tests::sparse_set_add_remove_many",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_is_send",
"tests::spawn_batch",
"tests::try_insert_batch",
"tests::try_insert_batch_if_new",
"world::command_queue::test::test_command_queue_inner",
"world::command_queue::test::test_command_queue_inner_drop_early",
"world::command_queue::test::test_command_queue_inner_drop",
"tests::take",
"tests::test_is_archetypal_size_hints",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::adding_observer_updates_location",
"world::entity_ref::tests::entity_mut_except",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::archetype_modifications_trigger_flush",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_except_conflicts_with_self - should panic",
"world::entity_ref::tests::entity_mut_except_conflicts_with_other - should panic",
"world::entity_ref::tests::entity_mut_except_doesnt_conflict",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_ref_except_conflicts_with_self - should panic",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_except",
"world::entity_ref::tests::entity_ref_except_conflicts_with_other - should panic",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::entity_ref_except_doesnt_conflict",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::get_by_id_array",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::get_by_id_vec",
"query::tests::query_filtered_exactsizeiterator_len",
"world::entity_ref::tests::get_mut_by_id_unchecked",
"world::entity_ref::tests::get_components",
"world::entity_ref::tests::get_mut_by_id_array",
"world::entity_ref::tests::get_mut_by_id_vec",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_compatible_with_resource",
"world::entity_ref::tests::mut_compatible_with_resource_mut",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::location_on_despawned_entity_panics - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_compatible_with_resource_mut",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_exclusive_system_param",
"world::identifier::tests::world_id_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::dynamic_resource",
"world::tests::get_entity_mut",
"world::tests::get_entity",
"world::tests::get_resource_by_id",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::reflect::tests::get_component_as_reflect",
"world::tests::init_resource_does_not_overwrite",
"world::reflect::tests::get_component_as_mut_reflect",
"world::tests::iter_resources",
"world::tests::iter_resources_mut",
"world::tests::inspect_entity_components",
"world::tests::spawn_empty_bundle",
"world::tests::iterate_entities_mut",
"world::tests::panic_while_overwriting_component",
"world::tests::iterate_entities",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1027) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1035) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 1773) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 356) - compile fail",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 108) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 244) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 254) - compile",
"crates/bevy_ecs/src/../README.md - (line 284)",
"crates/bevy_ecs/src/../README.md - (line 236)",
"crates/bevy_ecs/src/component.rs - component::Component (line 297)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 1789)",
"crates/bevy_ecs/src/../README.md - (line 188)",
"crates/bevy_ecs/src/../README.md - (line 164)",
"crates/bevy_ecs/src/component.rs - component::ComponentMutability (line 440)",
"crates/bevy_ecs/src/../README.md - (line 75)",
"crates/bevy_ecs/src/observer/mod.rs - observer::Trigger<'w,E,B>::observer (line 87)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/component.rs - component::Component (line 47)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 94)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 124)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 72)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 30)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 96)",
"crates/bevy_ecs/src/../README.md - (line 31)",
"crates/bevy_ecs/src/component.rs - component::Component (line 366)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 41)",
"crates/bevy_ecs/src/../README.md - (line 211)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 199)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 721)",
"crates/bevy_ecs/src/component.rs - component::Component (line 99)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 224)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 478)",
"crates/bevy_ecs/src/entity/clone_entities.rs - entity::clone_entities::EntityCloneBuilder (line 119)",
"crates/bevy_ecs/src/component.rs - component::Component (line 331)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 583)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 819)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining (line 64)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 2321)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 2307)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining_mut (line 101)",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 25)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 215) - compile fail",
"crates/bevy_ecs/src/label.rs - label::define_label (line 69)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 185) - compile fail",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 34)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 122)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 237) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 267) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 413) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 432) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 380) - compile fail",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 22)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 88)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/../README.md - (line 333)",
"crates/bevy_ecs/src/component.rs - component::Component (line 159)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 1488)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 192)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 254)",
"crates/bevy_ecs/src/component.rs - component::Component (line 253)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 407)",
"crates/bevy_ecs/src/component.rs - component::Component (line 215)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 207)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 407)",
"crates/bevy_ecs/src/../README.md - (line 42)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 248)",
"crates/bevy_ecs/src/../README.md - (line 52)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 127)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 174)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 229)",
"crates/bevy_ecs/src/../README.md - (line 308)",
"crates/bevy_ecs/src/entity/clone_entities.rs - entity::clone_entities::EntityCloneBuilder (line 87)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 12)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 118)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 144)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 67)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 41)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 142)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 1526)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 130)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 407)",
"crates/bevy_ecs/src/component.rs - component::Component (line 117)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryManyIter<'w,'s,D,F,I>::sort_by (line 1625)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 223)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 107)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 107)",
"crates/bevy_ecs/src/../README.md - (line 92)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 154)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 160)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 844)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 607)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemParamBuilder (line 21)",
"crates/bevy_ecs/src/../README.md - (line 123)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 116)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 68)",
"crates/bevy_ecs/src/component.rs - component::Component (line 189)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 211)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1889)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 239)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 59)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 816)",
"crates/bevy_ecs/src/component.rs - component::Component (line 137)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/observer/mod.rs - observer::World::add_observer (line 395)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 102)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 35)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 134)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 515)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 289)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 557)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 344)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 211)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 83)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 805)",
"crates/bevy_ecs/src/../README.md - (line 251)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryManyIter<'w,'s,D,F,I>::sort_unstable (line 1536)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryManyIter<'w,'s,D,F,I>::sort_by_key (line 1775)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 284) - compile fail",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1866)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 877)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 813)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 336)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryManyIter<'w,'s,D,F,I>::sort (line 1395)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed (line 1082)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 950)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 508)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 153)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 649)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 666)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 325)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 994)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 546)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 770)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1041)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 393)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed_to (line 1133)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::id (line 1173)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1453)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::retain (line 1710)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 623)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 230)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::remove (line 1567)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 14)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 926) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1037) - compile",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 251)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::try_insert (line 1423)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 27)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 533)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 395)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 414)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 568)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 571)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::reborrow (line 431)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::ParamBuilder (line 129)",
"crates/bevy_ecs/src/system/input.rs - system::input::In (line 54)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 585)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::remove_with_requires (line 1609)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 831)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::try_insert_if_new_and (line 1518)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::insert (line 1241)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 850)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 17)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 711) - compile fail",
"crates/bevy_ecs/src/system/builder.rs - system::builder::QueryParamBuilder (line 226)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::LocalBuilder (line 508)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::insert_if (line 1296)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 2030) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::try_insert_if (line 1471)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::run_schedule (line 1050)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::entry (line 1203)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 281)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 898)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 344)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 722)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 2006)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::despawn (line 1655)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 314)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 50)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 51)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 795)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::clone_entity (line 318)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 716)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::queue (line 610)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 901)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 209)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::clone_entity_with (line 279)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 1094)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 360)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 224)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 115)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_system (line 911)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::queue (line 1687)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 180)",
"crates/bevy_ecs/src/system/input.rs - system::input::InMut (line 157)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 527)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 131)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 201)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 251)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 474)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::ParamSetBuilder (line 339)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 234)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 822)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 164)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1223)",
"crates/bevy_ecs/src/system/input.rs - system::input::InRef (line 106)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 95)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 75)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1542)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 308)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 157)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1264)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 244)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 75)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 235)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1193)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 858)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 604)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 280)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 658)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 54)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 821)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 462)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 1064)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1585)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1299)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1146)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 267)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 570)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 300)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 500)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1342)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 599)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 193)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 136)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 979)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 147)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1430)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 1041)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 643)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1118)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1979)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 209)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 231)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 663)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 167)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 634)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 255)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 302)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 373)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 130) - compile",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 185)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 712)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 1172)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 214)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::DynSystemParam (line 2149)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 28)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 231)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 2241)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 682)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 2212)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 51)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 2322)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResources (line 96)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 218)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 2300)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 688)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResourcesMut (line 305)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 682)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 2154)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 168)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 85)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResources (line 24)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1494)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 623)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 2048)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 2345)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1558)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 2376)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 2182)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 1030)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 2441)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::FilteredEntityRef (line 2471)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResources (line 63)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 2267)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResourcesMut (line 256)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 744)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResourcesMut (line 345)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 765)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 640)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::FilteredEntityMut (line 2742)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 788)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_component_clone_handlers_mut (line 3348)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 2409)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 864)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 3442)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 1234)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 889)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1438)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_resource_or_init (line 2241)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1459)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 3420)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 1161)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 661)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 2393)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 855)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 999)",
"crates/bevy_ecs/src/world/mod.rs - world::World::register_required_components_with (line 368)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_resource_or_insert_with (line 2189)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 1197)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1588)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_query_filtered (line 1730)",
"crates/bevy_ecs/src/world/mod.rs - world::World::register_required_components (line 320)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 561)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 811)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 3519)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 3168)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 2861)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_query (line 1679)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_register_required_components_with (line 476)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_query (line 1707)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 30)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 1273)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_register_required_components (line 423)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1406)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 3783)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 900)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1655)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1624)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 1307)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 16,475
|
bevyengine__bevy-16475
|
[
"16474"
] |
6741e01dfa8876a6113adb79bdd475982e4d3e80
|
diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs
--- a/crates/bevy_image/src/image.rs
+++ b/crates/bevy_image/src/image.rs
@@ -944,19 +944,19 @@ impl Image {
let pixel_size = self.texture_descriptor.format.pixel_size();
let pixel_offset = match self.texture_descriptor.dimension {
TextureDimension::D3 => {
- if coords.x > width || coords.y > height || coords.z > depth {
+ if coords.x >= width || coords.y >= height || coords.z >= depth {
return None;
}
coords.z * height * width + coords.y * width + coords.x
}
TextureDimension::D2 => {
- if coords.x > width || coords.y > height {
+ if coords.x >= width || coords.y >= height {
return None;
}
coords.y * width + coords.x
}
TextureDimension::D1 => {
- if coords.x > width {
+ if coords.x >= width {
return None;
}
coords.x
|
diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs
--- a/crates/bevy_image/src/image.rs
+++ b/crates/bevy_image/src/image.rs
@@ -1573,4 +1573,28 @@ mod test {
assert_eq!(UVec2::ONE, image.size());
assert_eq!(Vec2::ONE, image.size_f32());
}
+
+ #[test]
+ fn on_edge_pixel_is_invalid() {
+ let image = Image::new_fill(
+ Extent3d {
+ width: 5,
+ height: 10,
+ depth_or_array_layers: 1,
+ },
+ TextureDimension::D2,
+ &[0, 0, 0, 255],
+ TextureFormat::Rgba8Unorm,
+ RenderAssetUsages::MAIN_WORLD,
+ );
+ assert!(matches!(image.get_color_at(4, 9), Ok(Color::BLACK)));
+ assert!(matches!(
+ image.get_color_at(0, 10),
+ Err(TextureAccessError::OutOfBounds { x: 0, y: 10, z: 0 })
+ ));
+ assert!(matches!(
+ image.get_color_at(5, 10),
+ Err(TextureAccessError::OutOfBounds { x: 5, y: 10, z: 0 })
+ ));
+ }
}
|
Calling `Image::get_color_at` panics
On #16388, we are using `Image::get_color_at` to determine a pixel's alpha value. There is no unwrap occuring, so we expect there to be no panics, however another user noted the following:
Testing the changes got this error after a crash:
```
2024-11-22T07:39:32.137594Z INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2024-11-22T07:39:32.137772Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2024-11-22T07:39:32.326951Z WARN bevy_render::view::window: Couldn't get swap chain texture after configuring. Cause: 'The underlying surface has changed, and therefore the swap chain must be updated'
thread 'Compute Task Pool (4)' panicked at /home/adrian/bevy_testing/bevy/crates/bevy_image/src/image.rs:974:36:
range end index 8 out of range for slice of length 4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_sprite::picking_backend::sprite_picking`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
```
I'm using 0.15 release branch with the changes applied on top. Running the sprite_picking example
The sprite on the right works fine, but the squares and bevy logos works quite bad and make the app crash.
The test run on linux with x11 as you can see in the errors
_Originally posted by @MonforteAdrian in https://github.com/bevyengine/bevy/issues/16388#issuecomment-2493084194_
|
2024-11-22T08:25:30Z
|
1.82
|
2024-11-22T18:34:57Z
|
6178ce93e8537f823685e8c1b617e22ba93696e7
|
[
"image::test::on_edge_pixel_is_invalid"
] |
[
"dds::test::dds_skybox",
"image_texture_conversion::test::two_way_conversion",
"ktx2::tests::test_ktx_levels",
"image::test::image_default_size",
"image::test::image_size"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 16,441
|
bevyengine__bevy-16441
|
[
"16406"
] |
4a6b686832a9ea19bc6738f4019bb58d9d052ee3
|
diff --git a/crates/bevy_ecs/src/component.rs b/crates/bevy_ecs/src/component.rs
--- a/crates/bevy_ecs/src/component.rs
+++ b/crates/bevy_ecs/src/component.rs
@@ -1029,8 +1029,8 @@ impl Components {
/// registration will be used.
pub(crate) unsafe fn register_required_components<R: Component>(
&mut self,
- required: ComponentId,
requiree: ComponentId,
+ required: ComponentId,
constructor: fn() -> R,
) -> Result<(), RequiredComponentsError> {
// SAFETY: The caller ensures that the `requiree` is valid.
diff --git a/crates/bevy_ecs/src/component.rs b/crates/bevy_ecs/src/component.rs
--- a/crates/bevy_ecs/src/component.rs
+++ b/crates/bevy_ecs/src/component.rs
@@ -1083,14 +1083,17 @@ impl Components {
for (component_id, component) in inherited_requirements.iter() {
// Register the required component.
- // The inheritance depth is increased by `1` since this is a component required by the original required component.
+ // The inheritance depth of inherited components is whatever the requiree's
+ // depth is relative to `required_by_id`, plus the inheritance depth of the
+ // inherited component relative to the requiree, plus 1 to account for the
+ // requiree in between.
// SAFETY: Component ID and constructor match the ones on the original requiree.
// The original requiree is responsible for making sure the registration is safe.
unsafe {
required_components.register_dynamic(
*component_id,
component.constructor.clone(),
- component.inheritance_depth + 1,
+ component.inheritance_depth + depth + 1,
);
};
}
diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs
--- a/crates/bevy_ecs/src/world/mod.rs
+++ b/crates/bevy_ecs/src/world/mod.rs
@@ -515,7 +515,7 @@ impl World {
// SAFETY: We just created the `required` and `requiree` components.
unsafe {
self.components
- .register_required_components::<R>(required, requiree, constructor)
+ .register_required_components::<R>(requiree, required, constructor)
}
}
|
diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs
--- a/crates/bevy_ecs/src/lib.rs
+++ b/crates/bevy_ecs/src/lib.rs
@@ -2399,6 +2399,40 @@ mod tests {
assert_eq!(world.entity(id).get::<Counter>().unwrap().0, 1);
}
+ #[test]
+ fn runtime_required_components_deep_require_does_not_override_shallow_require_deep_subtree_after_shallow(
+ ) {
+ #[derive(Component)]
+ struct A;
+ #[derive(Component, Default)]
+ struct B;
+ #[derive(Component, Default)]
+ struct C;
+ #[derive(Component, Default)]
+ struct D;
+ #[derive(Component, Default)]
+ struct E;
+ #[derive(Component)]
+ struct Counter(i32);
+ #[derive(Component, Default)]
+ struct F;
+
+ let mut world = World::new();
+
+ world.register_required_components::<A, B>();
+ world.register_required_components::<B, C>();
+ world.register_required_components::<C, D>();
+ world.register_required_components::<D, E>();
+ world.register_required_components_with::<E, Counter>(|| Counter(1));
+ world.register_required_components_with::<F, Counter>(|| Counter(2));
+ world.register_required_components::<E, F>();
+
+ let id = world.spawn(A).id();
+
+ // The "shallower" of the two components is used.
+ assert_eq!(world.entity(id).get::<Counter>().unwrap().0, 1);
+ }
+
#[test]
fn runtime_required_components_existing_archetype() {
#[derive(Component)]
|
Runtime required components do not work correctly for components added through `#[require(...)]`
## Bevy version
Bevy 0.15.0-rc.3
## What you did
I have a component, let's say `A`, that requires another component `B` using `#[require(B)]`. `B` then requires another component `C`, but the requirement is registered in a plugin using `app.register_required_components::<B, C>()`.
## What went wrong
When I spawn an entity with `A`, `C` is not added!
Here's a simple test that fails:
```rust
#[test]
fn runtime_required_components() {
// `A` requires `B` directly.
#[derive(Component)]
#[require(B)]
struct A;
#[derive(Component, Default)]
struct B;
#[derive(Component, Default)]
struct C;
let mut world = World::new();
// `B` requires `C` with runtime registration.
// This *fails*, but not when using `#[require(C)]` for `B`.
world.register_required_components::<B, C>();
// Adding runtime registration for `A -> B` also doesn't help if done after `B -> C`,
// but it *does* work if done before.
let _ = world.try_register_required_components::<A, B>();
let entity = world.spawn(A).id();
assert!(world.entity(entity).get::<C>().is_some());
}
```
If the entity is spawned with `B` directly, it *does* work:
```rust
#[test]
fn runtime_required_components_2() {
#[derive(Component)]
#[require(B)]
struct A;
#[derive(Component, Default)]
struct B;
#[derive(Component, Default)]
struct C;
let mut world = World::new();
world.register_required_components::<B, C>();
let _ = world.try_register_required_components::<A, B>();
let id = world.spawn(B).id();
assert!(world.entity(id).get::<C>().is_some());
}
```
This implies that the problem is related to runtime requirements not being properly propagated up the inheritance tree if the higher levels use `#[require(...)]`, or if the higher level requirement is added after the lower level requirement.
|
```rs
let mut world = World::new();
world.register_required_components::<B, C>();
let result = world.try_register_required_components::<A, B>();
assert!(result.is_ok());
let id = world.spawn(B).id();
assert!(world.entity(id).get::<C>().is_some());
```
The first assertion actually fails, so the problem seems to be with the attempt to register the required component.
`DuplicateRegistration(ComponentId(6), ComponentId(4))`
That one is supposed to return an error (hence why I used `try_`) since the requirement is already defined earlier with `#[require(B)]`. It's not related to the issue where the requirement for `A -> C` isn't added correctly
This isn't fully resolved by #16410:
```rust
#[test]
fn runtime_required_components_propagate_up_multiple() {
#[derive(Component)]
struct A;
#[derive(Component, Default)]
struct B;
#[derive(Component, Default)]
struct C;
#[derive(Component, Default)]
struct D;
let mut world = World::new();
world.register_required_components::<A, B>();
world.register_required_components::<B, C>();
world.register_required_components::<C, D>();
let id = world.spawn(A).id();
assert!(world.entity(id).get::<B>().is_some());
assert!(world.entity(id).get::<C>().is_some());
assert!(world.entity(id).get::<D>().is_some());
}
```
|
2024-11-20T00:43:21Z
|
1.82
|
2024-11-22T01:17:37Z
|
6178ce93e8537f823685e8c1b617e22ba93696e7
|
[
"tests::runtime_required_components_deep_require_does_not_override_shallow_require_deep_subtree_after_shallow"
] |
[
"bundle::tests::component_hook_order_insert_remove",
"bundle::tests::insert_if_new",
"change_detection::tests::as_deref_mut",
"bundle::tests::component_hook_order_spawn_despawn_with_macro_hooks",
"bundle::tests::component_hook_order_replace",
"bundle::tests::component_hook_order_spawn_despawn",
"change_detection::tests::mut_from_res_mut",
"bundle::tests::component_hook_order_recursive",
"change_detection::tests::map_mut",
"bundle::tests::component_hook_order_recursive_multiple",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::change_tick_scan",
"change_detection::tests::mut_new",
"change_detection::tests::mut_untyped_from_mut",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::change_expiration",
"change_detection::tests::set_if_neq",
"entity::map_entities::tests::entity_mapper",
"entity::tests::entity_bits_roundtrip",
"entity::map_entities::tests::entity_mapper_no_panic",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::tests::entity_comparison",
"entity::tests::entity_const",
"entity::tests::entity_debug",
"entity::tests::entity_display",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::entity_niche_optimization",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::collections::tests::iter_current_update_events_iterates_over_current_events",
"entity::visit_entities::tests::visit_entities",
"event::tests::test_event_cursor_clear",
"event::tests::test_event_cursor_iter_len_updated",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_cursor_len_current",
"event::tests::test_event_cursor_len_empty",
"event::tests::test_event_cursor_len_filled",
"event::tests::test_event_cursor_len_update",
"event::tests::test_event_cursor_read",
"event::tests::test_event_cursor_read_mut",
"event::tests::test_event_mutator_iter_last",
"event::tests::test_event_reader_iter_last",
"event::tests::test_events",
"event::tests::test_event_registry_can_add_and_remove_events_to_world",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_extend_impl",
"event::tests::test_events_send_default",
"event::tests::test_events_update_drain",
"event::tests::test_send_events_ids",
"identifier::masks::tests::extract_high_value",
"identifier::masks::tests::extract_kind",
"identifier::masks::tests::get_u64_parts",
"identifier::masks::tests::incrementing_masked_nonzero_high_is_safe",
"identifier::masks::tests::pack_into_u64",
"identifier::masks::tests::pack_kind_bits",
"identifier::tests::from_bits",
"identifier::tests::id_comparison",
"intern::tests::different_interned_content",
"identifier::tests::id_construction",
"intern::tests::fieldless_enum",
"intern::tests::same_interned_content",
"intern::tests::same_interned_instance",
"intern::tests::static_sub_strings",
"label::tests::dyn_eq_object_safe",
"intern::tests::zero_sized_type",
"label::tests::dyn_hash_object_safe",
"query::access::tests::test_access_clone",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_combined_access",
"query::access::tests::filtered_access_extend",
"query::access::tests::filtered_access_extend_or",
"observer::tests::observer_dynamic_trigger",
"observer::tests::observer_despawn",
"observer::tests::observer_apply_deferred_from_param_set",
"observer::tests::observer_invalid_params",
"query::access::tests::test_access_clone_from",
"query::access::tests::test_access_filters_clone",
"query::access::tests::test_filtered_access_clone",
"query::access::tests::read_all_access_conflicts",
"observer::tests::observer_multiple_listeners",
"observer::tests::observer_multiple_events",
"observer::tests::observer_propagating_no_next",
"observer::tests::observer_propagating_world",
"query::access::tests::test_filtered_access_clone_from",
"observer::tests::observer_no_target",
"query::access::tests::test_filtered_access_set_clone",
"query::access::tests::test_access_filters_clone_from",
"observer::tests::observer_order_spawn_despawn",
"observer::tests::observer_triggered_components",
"observer::tests::observer_order_insert_remove",
"observer::tests::observer_order_insert_remove_sparse",
"observer::tests::observer_multiple_components",
"query::builder::tests::builder_with_without_dynamic",
"observer::tests::observer_entity_routing",
"observer::tests::observer_trigger_targets_ref",
"observer::tests::observer_on_remove_during_despawn_spawn_empty",
"query::access::tests::test_filtered_access_set_from",
"observer::tests::observer_dynamic_component",
"observer::tests::observer_despawn_archetype_flags",
"observer::tests::observer_multiple_matches",
"query::fetch::tests::world_query_metadata_collision",
"observer::tests::observer_propagating",
"observer::tests::observer_order_replace",
"query::builder::tests::builder_dynamic_components",
"observer::tests::observer_trigger_ref",
"observer::tests::observer_propagating_parallel_propagation",
"observer::tests::observer_propagating_redundant_dispatch_parent_child",
"observer::tests::observer_propagating_join",
"query::builder::tests::builder_with_without_static",
"query::fetch::tests::read_only_field_visibility",
"observer::tests::observer_propagating_redundant_dispatch_same_entity",
"query::builder::tests::builder_static_components",
"observer::tests::observer_propagating_halt",
"query::error::test::query_does_not_match",
"observer::tests::observer_propagating_world_skipping",
"query::fetch::tests::world_query_phantom_data",
"observer::tests::observer_order_recursive",
"query::builder::tests::builder_transmute",
"query::builder::tests::builder_or",
"query::iter::tests::query_iter_cursor_state_non_empty_after_next",
"query::fetch::tests::world_query_struct_variants",
"query::state::tests::can_transmute_entity_mut",
"query::builder::tests::builder_static_dense_dynamic_sparse",
"query::state::tests::can_generalize_with_option",
"query::state::tests::can_transmute_changed",
"query::iter::tests::empty_query_sort_after_next_does_not_panic",
"query::state::tests::can_transmute_to_more_general",
"query::state::tests::can_transmute_empty_tuple",
"query::state::tests::can_transmute_mut_fetch",
"query::state::tests::can_transmute_immut_fetch",
"query::state::tests::can_transmute_filtered_entity",
"query::iter::tests::query_sorts",
"query::state::tests::can_transmute_added",
"query::state::tests::cannot_get_data_not_in_original_query",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::state::tests::transmute_from_dense_to_sparse",
"query::state::tests::transmute_from_sparse_to_dense",
"query::tests::multi_storage_query",
"query::state::tests::join_with_get",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::query_iter_combinations_sparse",
"query::tests::many_entities",
"query::tests::query",
"query::tests::has_query",
"query::tests::any_query",
"query::state::tests::join",
"schedule::condition::tests::distributive_run_if_compiles",
"reflect::entity_commands::tests::insert_reflect_bundle",
"reflect::entity_commands::tests::remove_reflected",
"query::tests::query_iter_combinations",
"query::tests::derived_worldqueries",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"reflect::entity_commands::tests::insert_reflected",
"schedule::executor::simple::skip_automatic_sync_points",
"reflect::entity_commands::tests::insert_reflect_bundle_with_registry",
"query::tests::query_filtered_iter_combinations",
"reflect::entity_commands::tests::remove_reflected_bundle",
"reflect::entity_commands::tests::remove_reflected_bundle_with_registry",
"schedule::set::tests::test_derive_schedule_label",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"schedule::set::tests::test_derive_system_set",
"query::state::tests::cannot_transmute_changed_without_access - should panic",
"query::state::tests::cannot_transmute_entity_ref - should panic",
"query::state::tests::cannot_transmute_immut_to_mut - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::cannot_transmute_option_to_immut - should panic",
"query::state::tests::transmute_with_different_world - should panic",
"query::iter::tests::query_sort_after_next_dense - should panic",
"query::iter::tests::query_sort_after_next - should panic",
"query::state::tests::cannot_join_wrong_fetch - should panic",
"query::tests::self_conflicting_worldquery - should panic",
"query::state::tests::cannot_transmute_to_include_data_not_in_original_query - should panic",
"query::state::tests::cannot_join_wrong_filter - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get - should panic",
"schedule::stepping::tests::clear_system",
"schedule::stepping::tests::clear_schedule",
"schedule::stepping::tests::clear_schedule_then_set_behavior",
"schedule::stepping::tests::multiple_calls_per_frame_step",
"schedule::stepping::tests::clear_breakpoint",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::stepping::tests::remove_schedule",
"schedule::stepping::tests::waiting_always_run",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::stepping::tests::continue_step_continue_with_breakpoint",
"schedule::stepping::tests::step_never_run",
"schedule::stepping::tests::schedules",
"schedule::stepping::tests::disabled_never_run",
"schedule::stepping::tests::continue_always_run",
"schedule::stepping::tests::stepping_disabled",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::stepping::tests::unknown_schedule",
"schedule::stepping::tests::continue_never_run",
"schedule::stepping::tests::step_duplicate_systems",
"schedule::stepping::tests::disabled_breakpoint",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::stepping::tests::multiple_calls_per_frame_continue",
"schedule::stepping::tests::waiting_never_run",
"schedule::stepping::tests::disabled_always_run",
"schedule::stepping::tests::waiting_breakpoint",
"schedule::stepping::tests::continue_breakpoint",
"schedule::stepping::tests::verify_cursor",
"schedule::stepping::tests::set_behavior_then_clear_schedule",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::stepping::tests::step_always_run",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::stepping::tests::step_breakpoint",
"schedule::tests::stepping::simple_executor",
"schedule::tests::stepping::single_threaded_executor",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::anonymous_set_name",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ambiguity::events",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"storage::blob_vec::tests::blob_vec",
"schedule::tests::system_ambiguity::read_component_and_entity_mut",
"schedule::tests::system_ambiguity::correct_ambiguities",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"storage::blob_vec::tests::blob_vec_capacity_overflow - should panic",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"storage::sparse_set::tests::sparse_set",
"schedule::tests::system_ambiguity::resource_mut_and_entity_ref",
"storage::blob_array::tests::make_sure_zst_components_get_dropped - should panic",
"schedule::tests::system_ambiguity::read_world",
"storage::blob_vec::tests::resize_test",
"storage::sparse_set::tests::sparse_sets",
"schedule::tests::system_ambiguity::shared_resource_mut_component",
"storage::blob_vec::tests::aligned_zst",
"system::builder::tests::custom_param_builder",
"system::builder::tests::filtered_resource_conflicts_read_with_res",
"system::builder::tests::dyn_builder",
"schedule::tests::system_ambiguity::one_of_everything",
"storage::table::tests::table",
"system::builder::tests::filtered_resource_mut_conflicts_read_with_res",
"system::builder::tests::filtered_resource_conflicts_read_with_resmut - should panic",
"system::builder::tests::filtered_resource_conflicts_read_all_with_resmut - should panic",
"schedule::tests::system_ambiguity::write_component_and_entity_ref",
"system::builder::tests::filtered_resource_mut_conflicts_write_with_res - should panic",
"system::builder::tests::local_builder",
"system::builder::tests::filtered_resource_mut_conflicts_write_all_with_res - should panic",
"schedule::tests::system_ambiguity::resource_and_entity_mut",
"system::builder::tests::filtered_resource_mut_conflicts_read_with_resmut - should panic",
"system::builder::tests::filtered_resource_mut_conflicts_write_with_resmut - should panic",
"system::builder::tests::multi_param_builder_inference",
"system::builder::tests::multi_param_builder",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"system::builder::tests::query_builder",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::tests::stepping::multi_threaded_executor",
"system::builder::tests::param_set_builder",
"event::tests::test_event_reader_iter_nth",
"system::builder::tests::query_builder_state",
"schedule::executor::tests::invalid_condition_param_skips_system",
"system::commands::tests::entity_commands_entry",
"schedule::tests::system_execution::run_exclusive_system",
"system::builder::tests::param_set_vec_builder",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"system::builder::tests::vec_builder",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::executor::tests::invalid_system_param_skips",
"system::commands::tests::append",
"system::commands::tests::insert_components",
"system::commands::tests::remove_components",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::commands::tests::test_commands_are_send_and_sync",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"system::system::tests::command_processing",
"schedule::schedule::tests::add_systems_to_non_existing_schedule",
"system::exclusive_function_system::tests::into_system_type_id_consistency",
"system::system::tests::non_send_resources",
"system::function_system::tests::into_system_type_id_consistency",
"system::system::tests::run_system_once",
"system::commands::tests::remove_components_by_id",
"schedule::stepping::tests::step_run_if_false",
"schedule::schedule::tests::add_systems_to_existing_schedule",
"schedule::executor::multi_threaded::tests::check_spawn_exclusive_system_task_miri",
"system::commands::tests::remove_resources",
"schedule::condition::tests::multiple_run_conditions",
"system::observer_system::tests::test_piped_observer_systems_with_inputs",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"schedule::schedule::tests::disable_auto_sync_points",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"schedule::schedule::tests::configure_set_on_new_schedule",
"system::observer_system::tests::test_piped_observer_systems_no_input",
"schedule::tests::conditions::systems_nested_in_system_sets",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"schedule::tests::conditions::system_with_condition",
"system::commands::tests::commands",
"schedule::executor::multi_threaded::tests::skipped_systems_notify_dependents",
"system::commands::tests::remove_component_with_required_components",
"schedule::tests::system_ambiguity::read_only",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::schedule::tests::configure_set_on_existing_schedule",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"schedule::tests::system_execution::run_system",
"system::system::tests::run_system_once_invalid_params",
"event::tests::test_event_mutator_iter_nth",
"schedule::set::tests::test_schedule_label",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"system::system::tests::run_two_systems",
"schedule::tests::conditions::systems_with_distributive_condition",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"system::system_name::tests::test_closure_system_name_regular_param",
"system::system_name::tests::test_system_name_exclusive_param",
"system::system_name::tests::test_exclusive_closure_system_name_regular_param",
"schedule::tests::system_ordering::add_systems_correct_order",
"system::system_param::tests::system_param_flexibility",
"schedule::schedule::tests::inserts_a_sync_point",
"system::system_param::tests::system_param_field_limit",
"system::system_param::tests::system_param_generic_bounds",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_const_generics",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_struct_variants",
"system::system_param::tests::system_param_where_clause",
"system::system_name::tests::test_system_name_regular_param",
"schedule::condition::tests::run_condition",
"schedule::condition::tests::run_condition_combinators",
"system::system_param::tests::non_sync_local",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::system_registry::tests::system_with_input_ref",
"system::system_registry::tests::cached_system_adapters",
"system::system_registry::tests::cached_system",
"system::system_registry::tests::cached_system_commands",
"system::system_registry::tests::exclusive_system",
"system::system_registry::tests::local_variables",
"system::system_registry::tests::output_values",
"system::system_registry::tests::run_system_invalid_params",
"system::system_registry::tests::system_with_input_mut",
"system::system_registry::tests::change_detection",
"schedule::schedule::tests::no_sync_chain::chain_second",
"system::system_registry::tests::nested_systems",
"system::system_param::tests::param_set_non_send_second",
"schedule::schedule::tests::no_sync_chain::chain_first",
"system::system_registry::tests::nested_systems_with_inputs",
"system::tests::any_of_has_filter_with_when_both_have_it",
"system::tests::any_of_and_without",
"system::system_registry::tests::input_values",
"system::tests::any_of_with_entity_and_mut",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"system::tests::any_of_with_empty_and_mut",
"system::system_param::tests::param_set_non_send_first",
"schedule::tests::system_ordering::order_systems",
"schedule::schedule::tests::no_sync_chain::chain_all",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::assert_entity_mut_system_does_conflict - should panic",
"system::tests::any_of_with_and_without_common",
"system::tests::assert_entity_ref_and_entity_mut_system_does_conflict - should panic",
"system::tests::can_have_16_parameters",
"schedule::schedule::tests::merges_sync_points_into_one",
"system::tests::any_of_with_mut_and_ref - should panic",
"system::tests::any_of_has_no_filter_with - should panic",
"event::tests::test_event_cursor_par_read_mut",
"system::tests::any_of_with_conflicting - should panic",
"system::tests::any_of_working",
"system::tests::any_of_with_ref_and_mut - should panic",
"system::tests::assert_world_and_entity_mut_system_does_conflict - should panic",
"query::tests::par_iter_mut_change_detection",
"system::tests::assert_systems",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::changed_trackers_or_conflict - should panic",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::commands_param_set",
"system::tests::get_system_conflicts",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::any_of_with_mut_and_option - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::long_life_test",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"event::tests::test_event_cursor_par_read",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::immutable_mut_test",
"system::tests::convert_mut_to_immut",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::disjoint_query_mut_system",
"system::tests::into_iter_impl",
"system::tests::local_system",
"system::tests::changed_resource_system",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::non_send_system",
"system::tests::non_send_option_system",
"system::tests::nonconflicting_system_resources",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::pipe_change_detection",
"system::tests::or_expanded_with_and_without_common",
"system::tests::query_is_empty",
"system::tests::query_validates_world_id - should panic",
"system::tests::or_has_filter_with",
"system::tests::or_has_filter_with_when_both_have_it",
"system::tests::simple_system",
"system::tests::panic_inside_system - should panic",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_archetype_update",
"system::tests::system_state_change_detection",
"system::tests::read_system_state",
"system::tests::query_set_system",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::write_system_state",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::or_param_set_system",
"system::tests::update_archetype_component_access_works",
"tests::changed_query",
"tests::added_tracking",
"tests::added_queries",
"system::tests::world_collections_system",
"system::tests::test_combinator_clone",
"tests::despawn_mixed_storage",
"tests::clear_entities",
"tests::bundle_derive",
"tests::despawn_table_storage",
"tests::add_remove_components",
"system::tests::removal_tracking",
"tests::dynamic_required_components",
"tests::empty_spawn",
"tests::duplicate_components_panic - should panic",
"tests::entity_ref_and_entity_mut_query_panic - should panic",
"tests::entity_mut_and_entity_mut_query_panic - should panic",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::changed_trackers",
"tests::changed_trackers_sparse",
"tests::entity_ref_and_entity_ref_query_no_panic",
"tests::filtered_query_access",
"tests::generic_required_components",
"tests::exact_size_query",
"tests::insert_batch",
"tests::insert_batch_if_new",
"tests::insert_or_spawn_batch",
"tests::insert_overwrite_drop",
"tests::insert_or_spawn_batch_invalid",
"tests::insert_overwrite_drop_sparse",
"tests::insert_batch_same_archetype",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::multiple_worlds_same_query_get - should panic",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::mut_and_mut_query_panic - should panic",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::non_send_resource",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::non_send_resource_points_to_distinct_data",
"tests::non_send_resource_drop_from_different_thread - should panic",
"tests::query_all",
"tests::non_send_resource_panic - should panic",
"tests::query_all_for_each",
"tests::query_filter_with",
"tests::query_filter_with_for_each",
"tests::par_for_each_dense",
"tests::par_for_each_sparse",
"tests::query_filter_with_sparse",
"tests::query_filters_dont_collide_with_fetches",
"tests::query_filter_with_sparse_for_each",
"tests::query_filter_without",
"tests::query_get",
"tests::query_missing_component",
"tests::query_optional_component_sparse",
"tests::query_optional_component_sparse_no_match",
"tests::query_get_works_across_sparse_removal",
"tests::query_optional_component_table",
"tests::query_single_component",
"query::tests::query_filtered_exactsizeiterator_len",
"tests::ref_and_mut_query_panic - should panic",
"tests::query_single_component_for_each",
"tests::query_sparse_component",
"tests::random_access",
"tests::remove",
"tests::remove_missing",
"tests::remove_bundle_and_his_required_components",
"tests::remove_component_and_his_required_components",
"tests::remove_component_and_his_runtime_required_components",
"tests::required_components",
"tests::remove_tracking",
"tests::required_components_insert_existing_hooks",
"tests::required_components_inheritance_depth",
"tests::required_components_retain_keeps_required",
"tests::required_components_spawn_nonexistent_hooks",
"tests::required_components_spawn_then_insert_no_overwrite",
"tests::required_components_take_leaves_required",
"tests::reserve_and_spawn",
"tests::resource",
"tests::resource_scope",
"tests::runtime_required_components_existing_archetype",
"tests::runtime_required_components_fail_with_duplicate",
"tests::runtime_required_components_deep_require_does_not_override_shallow_require",
"tests::runtime_required_components_override_1",
"tests::runtime_required_components",
"tests::runtime_required_components_override_2",
"tests::runtime_required_components_propagate_up",
"tests::runtime_required_components_propagate_up_even_more",
"tests::sparse_set_add_remove_many",
"tests::spawn_batch",
"tests::stateful_query_handles_new_archetype",
"world::command_queue::test::test_command_is_send",
"tests::try_insert_batch",
"world::command_queue::test::test_command_queue_inner",
"tests::take",
"world::command_queue::test::test_command_queue_inner_drop_early",
"tests::try_insert_batch_if_new",
"world::command_queue::test::test_command_queue_inner_drop",
"world::command_queue::test::test_command_queue_inner_panic_safe",
"world::command_queue::test::test_command_queue_inner_nested_panic_safe",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_except",
"world::entity_ref::tests::entity_mut_except_conflicts_with_self - should panic",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_except_doesnt_conflict",
"world::entity_ref::tests::entity_mut_except_conflicts_with_other - should panic",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_mut_remove_by_id",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"world::entity_ref::tests::entity_ref_except",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_except_conflicts_with_self - should panic",
"world::entity_ref::tests::entity_ref_except_conflicts_with_other - should panic",
"world::entity_ref::tests::entity_ref_except_doesnt_conflict",
"world::entity_ref::tests::filtered_entity_mut_missing",
"world::entity_ref::tests::filtered_entity_ref_missing",
"world::entity_ref::tests::filtered_entity_mut_normal",
"world::entity_ref::tests::filtered_entity_ref_normal",
"world::entity_ref::tests::get_by_id_array",
"world::entity_ref::tests::get_by_id_vec",
"world::entity_ref::tests::get_components",
"world::entity_ref::tests::get_mut_by_id_array",
"world::entity_ref::tests::get_mut_by_id_unchecked",
"world::entity_ref::tests::get_mut_by_id_vec",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_compatible_with_resource",
"world::entity_ref::tests::mut_compatible_with_resource_mut",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::ref_compatible_with_resource_mut",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_ids_unique",
"world::identifier::tests::world_id_exclusive_system_param",
"world::identifier::tests::world_id_system_param",
"world::tests::custom_resource_with_layout",
"world::tests::dynamic_resource",
"world::tests::get_entity",
"world::tests::get_entity_mut",
"world::reflect::tests::get_component_as_reflect",
"world::tests::get_resource_by_id",
"world::reflect::tests::get_component_as_mut_reflect",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iter_resources",
"world::tests::iter_resources_mut",
"world::tests::inspect_entity_components",
"world::tests::spawn_empty_bundle",
"world::tests::iterate_entities_mut",
"world::tests::panic_while_overwriting_component",
"world::tests::iterate_entities",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1027) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 1035) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 242) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 348) - compile fail",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 108) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 252) - compile",
"crates/bevy_ecs/src/lib.rs - (line 213)",
"crates/bevy_ecs/src/component.rs - component::Component (line 91)",
"crates/bevy_ecs/src/component.rs - component::Component (line 45)",
"crates/bevy_ecs/src/lib.rs - (line 166)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 400)",
"crates/bevy_ecs/src/lib.rs - (line 238)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator (line 16)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 41)",
"crates/bevy_ecs/src/component.rs - component::Component (line 358)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 199)",
"crates/bevy_ecs/src/lib.rs - (line 190)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 124)",
"crates/bevy_ecs/src/component.rs - component::Component (line 289)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 94)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 721)",
"crates/bevy_ecs/src/lib.rs - (line 286)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::EntityMapper (line 72)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 40)",
"crates/bevy_ecs/src/lib.rs - (line 33)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 95)",
"crates/bevy_ecs/src/component.rs - component::Component (line 323)",
"crates/bevy_ecs/src/observer/mod.rs - observer::Trigger<'w,E,B>::observer (line 86)",
"crates/bevy_ecs/src/lib.rs - (line 77)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 583)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 30)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 819)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 224)",
"crates/bevy_ecs/src/event/collections.rs - event::collections::Events (line 41)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1512)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 1498)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining (line 63)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::remaining_mut (line 100)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 215) - compile fail",
"crates/bevy_ecs/src/query/par_iter.rs - query::par_iter::QueryParIter<'w,'s,D,F>::for_each_init (line 49)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nand (line 185) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 237) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::nor (line 267) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 25)",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 18)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 34)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 380) - compile fail",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 122)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xnor (line 413) - compile fail",
"crates/bevy_ecs/src/label.rs - label::define_label (line 69)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::xor (line 432) - compile fail",
"crates/bevy_ecs/src/intern.rs - intern::Interned (line 22)",
"crates/bevy_ecs/src/lib.rs - (line 44)",
"crates/bevy_ecs/src/component.rs - component::Component (line 151)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::is_empty (line 116)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 106)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 173)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder<'w,D,F>::or (line 207)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 105)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 222)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::is_empty (line 88)",
"crates/bevy_ecs/src/component.rs - component::Component (line 109)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1865)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 703)",
"crates/bevy_ecs/src/component.rs - component::Component (line 129)",
"crates/bevy_ecs/src/lib.rs - (line 310)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 67)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 344)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 191)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/query/builder.rs - query::builder::QueryBuilder (line 12)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 211)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 667)",
"crates/bevy_ecs/src/lib.rs - (line 54)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 769)",
"crates/bevy_ecs/src/component.rs - component::ComponentHooks (line 437)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 129)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 210)",
"crates/bevy_ecs/src/component.rs - component::Component (line 207)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::SystemParamBuilder (line 20)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 125)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 66)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 959)",
"crates/bevy_ecs/src/component.rs - component::Component (line 245)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 841)",
"crates/bevy_ecs/src/component.rs - component::Component (line 181)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by (line 648)",
"crates/bevy_ecs/src/event/event_cursor.rs - event::event_cursor::EventCursor (line 32)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 144)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 141)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 102)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::par_iter_mut (line 1417)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 134)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 154)",
"crates/bevy_ecs/src/lib.rs - (line 253)",
"crates/bevy_ecs/src/lib.rs - (line 335)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 254)",
"crates/bevy_ecs/src/event/writer.rs - event::writer::EventWriter (line 12)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::reborrow (line 237)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 229)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_by_key (line 812)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 159)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 153)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 666)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1888)",
"crates/bevy_ecs/src/observer/mod.rs - observer::World::add_observer (line 394)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 247)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut (line 816)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 276) - compile fail",
"crates/bevy_ecs/src/lib.rs - (line 94)",
"crates/bevy_ecs/src/observer/runner.rs - observer::runner::Observer (line 129)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 118)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 607)",
"crates/bevy_ecs/src/event/reader.rs - event::reader::EventReader<'w,'s,E>::par_read (line 40)",
"crates/bevy_ecs/src/event/mutator.rs - event::mutator::EventMutator<'w,'s,E>::par_read (line 68)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or (line 289)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 994)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort_unstable (line 556)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and (line 83)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 59)",
"crates/bevy_ecs/src/lib.rs - (line 125)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed (line 1082)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 546)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 336)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 844)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::condition_changed_to (line 1133)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 14)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 770)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 250)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 716)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 1041)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 508)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 831)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 623)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 924) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1035) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 35)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::QueryParamBuilder (line 225)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 531)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 898)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 569)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::LocalBuilder (line 507)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 279)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 785)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 349)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::id (line 1061)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 462)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 757)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::queue (line 545)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 950)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 48)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::reborrow (line 429)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 730)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 409)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 392)",
"crates/bevy_ecs/src/system/input.rs - system::input::InMut (line 157)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 709) - compile fail",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 27)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 2028) - compile fail",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 325)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::register_system (line 846)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::remove (line 1455)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 585)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::insert_if (line 1184)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::entry (line 1091)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 17)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 982)",
"crates/bevy_ecs/src/system/input.rs - system::input::In (line 54)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 232)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::queue (line 1575)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 720)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 49)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::insert (line 1129)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 2004)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 224)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 243)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 308)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 359)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1144)",
"crates/bevy_ecs/src/system/input.rs - system::input::InRef (line 106)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::despawn (line 1543)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 242)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 503)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1262)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1540)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 115)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::ParamBuilder (line 128)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 265)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1221)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 842)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 156)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1583)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::par_iter_mut (line 819)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 157)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryIter<'w,'s,D,F>::sort (line 394)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1116)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::try_insert_if (line 1359)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 856)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::try_insert_if_new_and (line 1406)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 228)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 234)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 75)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 54)",
"crates/bevy_ecs/src/system/builder.rs - system::builder::ParamSetBuilder (line 338)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 656)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 602)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 193)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::try_insert (line 1311)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 498)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 1039)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 977)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::remove_with_requires (line 1497)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 209)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 131)",
"crates/bevy_ecs/src/world/mod.rs - world::Command (line 74)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 632)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 83)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 180)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 597)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 280)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 631)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 1062)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 373)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 231)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'a>::retain (line 1598)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 134)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 651)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 209)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 215)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 190)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 95)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 700)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1795)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 231)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 1170)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 185)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 300)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1297)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 235)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef<'w>::get_by_id (line 167)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::join (line 1428)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 302)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 267)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1191)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 129) - compile",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1848)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut<'w>::get_mut_by_id (line 676)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 144)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 568)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 50)",
"crates/bevy_ecs/src/world/deferred_world.rs - world::deferred_world::DeferredWorld<'w>::entity_mut (line 165)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 2140)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::DynSystemParam (line 2147)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 2187)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 255)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1962)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 560)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::FilteredEntityMut (line 2545)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 680)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResources (line 96)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 214)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResourcesMut (line 345)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 460)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 2080)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::transmute_lens (line 1340)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1992)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResources (line 63)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 28)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 1490)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 2107)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 681)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::FilteredEntityRef (line 2274)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 2244)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_from_set_mut (line 1233)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_resource_or_init (line 2159)",
"crates/bevy_ecs/src/world/mod.rs - world::World::last_change_tick_scope (line 3086)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources_mut (line 3408)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1936)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 639)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic (line 1029)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 660)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 622)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 2021)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 787)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 2047)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 1160)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_resource_or_insert_with (line 2107)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 743)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResourcesMut (line 305)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 3309)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_dynamic_mut (line 1196)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResources (line 24)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 2219)",
"crates/bevy_ecs/src/world/mod.rs - world::World::iter_resources (line 3331)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 1554)",
"crates/bevy_ecs/src/world/mod.rs - world::World::register_required_components_with (line 367)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 2164)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 1437)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 2311)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 810)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 899)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 863)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 764)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_register_required_components_with (line 475)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 998)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 2779)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 1458)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 888)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1620)",
"crates/bevy_ecs/src/world/filtered_resource.rs - world::filtered_resource::FilteredResourcesMut (line 256)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 854)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 3671)",
"crates/bevy_ecs/src/world/mod.rs - world::World::register_required_components (line 319)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 1584)",
"crates/bevy_ecs/src/world/mod.rs - world::World::try_register_required_components (line 422)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 1272)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 1405)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 1306)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1651)",
"crates/bevy_ecs/src/world/reflect.rs - world::reflect::World::get_reflect (line 30)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 16,264
|
bevyengine__bevy-16264
|
[
"16223"
] |
a967c75e92aa08704f11459e4597f6a24bc476c3
|
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -11,7 +11,6 @@ use bevy_ecs::component::Component;
use bevy_ecs::{
change_detection::{DetectChanges, Ref},
entity::Entity,
- event::EventReader,
prelude::{ReflectComponent, With},
query::{Changed, Without},
system::{Commands, Local, Query, Res, ResMut},
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -30,7 +29,7 @@ use bevy_sprite::{Anchor, ExtractedSprite, ExtractedSprites, SpriteSource, Textu
use bevy_transform::components::Transform;
use bevy_transform::prelude::GlobalTransform;
use bevy_utils::HashSet;
-use bevy_window::{PrimaryWindow, Window, WindowScaleFactorChanged};
+use bevy_window::{PrimaryWindow, Window};
/// [`Text2dBundle`] was removed in favor of required components.
/// The core component is now [`Text2d`] which can contain a single text segment.
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -235,12 +234,12 @@ pub fn extract_text2d_sprite(
/// It does not modify or observe existing ones.
#[allow(clippy::too_many_arguments)]
pub fn update_text2d_layout(
+ mut last_scale_factor: Local<f32>,
// Text items which should be reprocessed again, generally when the font hasn't loaded yet.
mut queue: Local<HashSet<Entity>>,
mut textures: ResMut<Assets<Image>>,
fonts: Res<Assets<Font>>,
windows: Query<&Window, With<PrimaryWindow>>,
- mut scale_factor_changed: EventReader<WindowScaleFactorChanged>,
mut texture_atlases: ResMut<Assets<TextureAtlasLayout>>,
mut font_atlas_sets: ResMut<FontAtlasSets>,
mut text_pipeline: ResMut<TextPipeline>,
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -255,9 +254,6 @@ pub fn update_text2d_layout(
mut font_system: ResMut<CosmicFontSystem>,
mut swash_cache: ResMut<SwashCache>,
) {
- // We need to consume the entire iterator, hence `last`
- let factor_changed = scale_factor_changed.read().last().is_some();
-
// TODO: Support window-independent scaling: https://github.com/bevyengine/bevy/issues/5621
let scale_factor = windows
.get_single()
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -266,6 +262,9 @@ pub fn update_text2d_layout(
let inverse_scale_factor = scale_factor.recip();
+ let factor_changed = *last_scale_factor != scale_factor;
+ *last_scale_factor = scale_factor;
+
for (entity, block, bounds, text_layout_info, mut computed) in &mut text_query {
if factor_changed
|| computed.needs_rerender()
|
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -359,7 +358,7 @@ mod tests {
use bevy_app::{App, Update};
use bevy_asset::{load_internal_binary_asset, Handle};
- use bevy_ecs::{event::Events, schedule::IntoSystemConfigs};
+ use bevy_ecs::schedule::IntoSystemConfigs;
use crate::{detect_text_needs_rerender, TextIterScratch};
diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs
--- a/crates/bevy_text/src/text2d.rs
+++ b/crates/bevy_text/src/text2d.rs
@@ -374,7 +373,6 @@ mod tests {
.init_resource::<Assets<Image>>()
.init_resource::<Assets<TextureAtlasLayout>>()
.init_resource::<FontAtlasSets>()
- .init_resource::<Events<WindowScaleFactorChanged>>()
.init_resource::<TextPipeline>()
.init_resource::<CosmicFontSystem>()
.init_resource::<SwashCache>()
|
Text doesn't respond correctly to scale changes
## Bevy version
Bevy 0.15.0-rc.2
## What you did
I spawned a `Text2d` during `Setup`
## What went wrong
The text gets a different size and position at a scale factor of 2 compared to a scale factor of 1.
## Additional information
Text that is updated after the scale factor is applied seems to behave as expected.
Scale factor 1:

Scale factor 2:

The FPS text is updated each frame and thus avoids this issue.
|
2024-11-06T16:31:21Z
|
1.82
|
2024-11-13T21:42:11Z
|
6178ce93e8537f823685e8c1b617e22ba93696e7
|
[
"text2d::tests::calculate_bounds_text2d_update_aabb",
"text2d::tests::calculate_bounds_text2d_create_aabb"
] |
[
"crates/bevy_text/src/text.rs - text::TextSpan (line 162)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 11,167
|
bevyengine__bevy-11167
|
[
"10797"
] |
425570aa752b32ef26f6573b385d49d6254bd868
|
diff --git a/crates/bevy_ecs/src/storage/blob_vec.rs b/crates/bevy_ecs/src/storage/blob_vec.rs
--- a/crates/bevy_ecs/src/storage/blob_vec.rs
+++ b/crates/bevy_ecs/src/storage/blob_vec.rs
@@ -124,6 +124,23 @@ impl BlobVec {
}
}
+ /// Reserves the minimum capacity for at least `additional` more elements to be inserted in the given `BlobVec`.
+ #[inline]
+ pub fn reserve(&mut self, additional: usize) {
+ /// Similar to `reserve_exact`. This method ensures that the capacity will grow at least `self.capacity()` if there is no
+ /// enough space to hold `additional` more elements.
+ #[cold]
+ fn do_reserve(slf: &mut BlobVec, additional: usize) {
+ let increment = slf.capacity.max(additional - (slf.capacity - slf.len));
+ let increment = NonZeroUsize::new(increment).unwrap();
+ slf.grow_exact(increment);
+ }
+
+ if self.capacity - self.len < additional {
+ do_reserve(self, additional);
+ }
+ }
+
/// Grows the capacity by `increment` elements.
///
/// # Panics
diff --git a/crates/bevy_ecs/src/storage/blob_vec.rs b/crates/bevy_ecs/src/storage/blob_vec.rs
--- a/crates/bevy_ecs/src/storage/blob_vec.rs
+++ b/crates/bevy_ecs/src/storage/blob_vec.rs
@@ -241,7 +258,7 @@ impl BlobVec {
/// The `value` must match the [`layout`](`BlobVec::layout`) of the elements in the [`BlobVec`].
#[inline]
pub unsafe fn push(&mut self, value: OwningPtr<'_>) {
- self.reserve_exact(1);
+ self.reserve(1);
let index = self.len;
self.len += 1;
self.initialize_unchecked(index, value);
|
diff --git a/crates/bevy_ecs/src/storage/blob_vec.rs b/crates/bevy_ecs/src/storage/blob_vec.rs
--- a/crates/bevy_ecs/src/storage/blob_vec.rs
+++ b/crates/bevy_ecs/src/storage/blob_vec.rs
@@ -530,7 +547,7 @@ mod tests {
}
assert_eq!(blob_vec.len(), 1_000);
- assert_eq!(blob_vec.capacity(), 1_000);
+ assert_eq!(blob_vec.capacity(), 1_024);
}
#[derive(Debug, Eq, PartialEq, Clone)]
diff --git a/crates/bevy_ecs/src/storage/blob_vec.rs b/crates/bevy_ecs/src/storage/blob_vec.rs
--- a/crates/bevy_ecs/src/storage/blob_vec.rs
+++ b/crates/bevy_ecs/src/storage/blob_vec.rs
@@ -590,19 +607,19 @@ mod tests {
push(&mut blob_vec, foo3.clone());
assert_eq!(blob_vec.len(), 3);
- assert_eq!(blob_vec.capacity(), 3);
+ assert_eq!(blob_vec.capacity(), 4);
let last_index = blob_vec.len() - 1;
let value = swap_remove::<Foo>(&mut blob_vec, last_index);
assert_eq!(foo3, value);
assert_eq!(blob_vec.len(), 2);
- assert_eq!(blob_vec.capacity(), 3);
+ assert_eq!(blob_vec.capacity(), 4);
let value = swap_remove::<Foo>(&mut blob_vec, 0);
assert_eq!(foo1, value);
assert_eq!(blob_vec.len(), 1);
- assert_eq!(blob_vec.capacity(), 3);
+ assert_eq!(blob_vec.capacity(), 4);
foo2.a = 8;
assert_eq!(get_mut::<Foo>(&mut blob_vec, 0), &foo2);
|
BlobVec::push is linear
```rust
#[test]
fn test_quadratic() {
unsafe {
let mut vec = BlobVec::new(Layout::new::<u64>(), None, 0);
for i in 0..100_000_000 {
if i % 1_000_000 == 0 {
println!("{i}");
}
OwningPtr::make(i, |ptr| {
vec.push(ptr);
});
hint::black_box(&mut vec);
}
}
}
#[test]
fn test_quadratic_vec() {
let mut vec = Vec::new();
for i in 0..100_000_000 {
if i % 1_000_000 == 0 {
println!("{i}");
}
vec.push(i);
hint::black_box(&mut vec);
}
}
```
Second test finishes in a second.
First test never finishes, and shows it gets slower with each iteration.
It is not noticable in typical application because:
* `reserve_exact` before `push` (which is how `BlobVec` is used) makes effect less visible (yet keeping insertion kind of quadratic)
* on small `BlobVec` `realloc` often reallocates in place or reallocates to double size, making `push` effectively constant even with unnecessary call to `realloc`. But on larger allocations malloc no longer doubles the size making `push` very expensive.
|
2024-01-01T09:47:01Z
|
0.12
|
2024-01-22T15:25:33Z
|
e6e25dead4d4b274e439f0050a2595b42b009dd2
|
[
"storage::blob_vec::tests::blob_vec",
"storage::blob_vec::tests::resize_test"
] |
[
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_from_res_mut",
"change_detection::tests::mut_new",
"change_detection::tests::as_deref_mut",
"change_detection::tests::change_tick_wraparound",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::change_tick_scan",
"change_detection::tests::set_if_neq",
"change_detection::tests::change_expiration",
"entity::map_entities::tests::entity_mapper",
"entity::map_entities::tests::world_scope_reserves_generations",
"entity::tests::entity_bits_roundtrip",
"entity::tests::entity_comparison",
"entity::tests::entity_const",
"entity::tests::entity_hash_id_bitflip_affects_high_7_bits",
"entity::tests::entity_hash_keeps_similar_ids_together",
"entity::tests::get_reserved_and_invalid",
"entity::tests::reserve_entity_len",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_len_updated",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_extend_impl",
"event::tests::test_firing_empty_event",
"event::tests::test_send_events_ids",
"event::tests::test_update_drain",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_access_extend",
"query::access::tests::read_all_access_conflicts",
"query::access::tests::filtered_combined_access",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_metadata_collision",
"query::fetch::tests::world_query_phantom_data",
"query::fetch::tests::world_query_struct_variants",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::tests::any_query",
"query::tests::has_query",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get - should panic",
"query::state::tests::right_world_get_many - should panic",
"query::tests::multi_storage_query",
"query::tests::many_entities",
"query::tests::query",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::query_iter_combinations",
"query::tests::query_iter_combinations_sparse",
"query::tests::derived_worldqueries",
"query::tests::self_conflicting_worldquery - should panic",
"query::tests::query_filtered_iter_combinations",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::insert_reflected",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"schedule::condition::tests::distributive_run_if_compiles",
"schedule::set::tests::test_derive_system_set",
"schedule::set::tests::test_derive_schedule_label",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::system_ambiguity::resources",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::one_of_everything",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::system_ambiguity::exclusive",
"schedule::tests::system_ambiguity::components",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::anonymous_set_name",
"system::commands::command_queue::test::test_command_is_send",
"system::commands::command_queue::test::test_command_queue_inner",
"storage::table::tests::table",
"system::commands::command_queue::test::test_command_queue_inner_drop",
"storage::blob_vec::tests::blob_vec_zst_size_overflow - should panic",
"storage::sparse_set::tests::sparse_sets",
"schedule::tests::system_ambiguity::events",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::read_world",
"storage::sparse_set::tests::sparse_set",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"schedule::tests::system_ambiguity::correct_ambiguities",
"system::commands::command_queue::test::test_command_queue_inner_drop_early",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"system::commands::tests::append",
"system::commands::tests::remove_resources",
"system::commands::command_queue::test::test_command_queue_inner_panic_safe",
"system::commands::tests::commands",
"system::system::tests::command_processing",
"system::commands::tests::remove_components",
"system::system::tests::non_send_resources",
"system::system::tests::run_system_once",
"system::system::tests::run_two_systems",
"system::system_name::tests::test_system_name_regular_param",
"system::system_name::tests::test_system_name_exclusive_param",
"schedule::tests::system_ambiguity::read_only",
"system::system_param::tests::system_param_flexibility",
"system::system_param::tests::system_param_field_limit",
"system::system_param::tests::system_param_const_generics",
"system::system_param::tests::system_param_generic_bounds",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_struct_variants",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_where_clause",
"system::system_registry::tests::input_values",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::change_detection",
"system::system_registry::tests::output_values",
"system::system_registry::tests::local_variables",
"system::system_registry::tests::nested_systems_with_inputs",
"system::tests::get_system_conflicts",
"system::tests::immutable_mut_test",
"system::tests::long_life_test",
"system::tests::can_have_16_parameters",
"system::tests::convert_mut_to_immut",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::any_of_has_no_filter_with - should panic",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::assert_systems",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::pipe_change_detection",
"system::tests::query_validates_world_id - should panic",
"schedule::schedule::tests::no_sync_edges::system_to_system_before",
"schedule::tests::conditions::system_with_condition",
"system::tests::simple_system",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"schedule::tests::system_execution::run_exclusive_system",
"system::tests::write_system_state",
"system::tests::system_state_invalid_world - should panic",
"system::tests::system_state_change_detection",
"system::tests::commands_param_set",
"system::system_param::tests::param_set_non_send_first",
"system::system_param::tests::param_set_non_send_second",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::system_state_archetype_update",
"schedule::tests::system_execution::run_system",
"system::tests::query_is_empty",
"system::tests::update_archetype_component_access_works",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"system::tests::into_iter_impl",
"tests::add_remove_components",
"tests::changed_query",
"tests::added_queries",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"system::tests::nonconflicting_system_resources",
"tests::clear_entities",
"schedule::schedule::tests::no_sync_edges::set_to_set_before",
"system::system_param::tests::non_sync_local",
"tests::added_tracking",
"system::tests::read_system_state",
"tests::changed_trackers_sparse",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"tests::despawn_mixed_storage",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"tests::exact_size_query",
"tests::empty_spawn",
"system::tests::any_of_and_without",
"system::tests::local_system",
"tests::bundle_derive",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::test_combinator_clone",
"tests::insert_overwrite_drop_sparse",
"tests::duplicate_components_panic - should panic",
"tests::entity_ref_and_mut_query_panic - should panic",
"schedule::schedule::tests::disable_auto_sync_points",
"system::tests::or_expanded_nested_with_and_without_common",
"tests::despawn_table_storage",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::conditions::systems_nested_in_system_sets",
"tests::insert_overwrite_drop",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"tests::insert_or_spawn_batch_invalid",
"tests::filtered_query_access",
"schedule::tests::system_ordering::order_exclusive_systems",
"tests::changed_trackers",
"event::tests::test_event_iter_nth",
"query::tests::query_filtered_exactsizeiterator_len",
"system::tests::non_send_option_system",
"tests::insert_or_spawn_batch",
"tests::multiple_worlds_same_query_for_each - should panic",
"system::tests::query_system_gets",
"schedule::tests::system_ordering::add_systems_correct_order",
"schedule::schedule::tests::no_sync_edges::set_to_system_before",
"system::tests::panic_inside_system - should panic",
"schedule::schedule::tests::no_sync_edges::set_to_system_after",
"system::tests::or_expanded_with_and_without_common",
"schedule::tests::conditions::systems_with_distributive_condition",
"tests::multiple_worlds_same_query_get - should panic",
"system::exclusive_system_param::tests::test_exclusive_system_params",
"system::tests::or_with_without_and_compatible_with_without",
"system::tests::any_of_has_filter_with_when_both_have_it",
"schedule::schedule::tests::inserts_a_sync_point",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::mut_and_ref_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"system::tests::query_set_system",
"tests::multiple_worlds_same_query_iter - should panic",
"schedule::condition::tests::run_condition_combinators",
"system::tests::readonly_query_get_mut_component_fails",
"system::tests::or_has_filter_with_when_both_have_it",
"schedule::set::tests::test_schedule_label",
"tests::non_send_resource",
"schedule::condition::tests::multiple_run_conditions",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"schedule::schedule::tests::no_sync_edges::set_to_set_after",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"schedule::schedule::tests::no_sync_edges::system_to_system_after",
"system::tests::disjoint_query_mut_system",
"system::tests::world_collections_system",
"system::tests::non_send_system",
"system::tests::or_param_set_system",
"system::tests::or_has_filter_with",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"tests::mut_and_mut_query_panic - should panic",
"system::tests::removal_tracking",
"system::tests::changed_resource_system",
"schedule::condition::tests::run_condition",
"tests::non_send_resource_panic - should panic",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"schedule::tests::conditions::system_conditions_and_change_detection",
"schedule::schedule::tests::adds_multiple_consecutive_syncs",
"tests::query_all",
"tests::query_all_for_each",
"tests::query_filter_with",
"tests::non_send_resource_drop_from_different_thread - should panic",
"schedule::schedule::tests::no_sync_chain::only_chain_outside",
"tests::query_filter_with_sparse_for_each",
"tests::query_filter_without",
"tests::non_send_resource_points_to_distinct_data",
"tests::query_get",
"tests::query_filter_with_for_each",
"tests::query_get_works_across_sparse_removal",
"tests::query_filter_with_sparse",
"tests::query_missing_component",
"schedule::schedule::tests::no_sync_chain::chain_all",
"schedule::schedule::tests::no_sync_chain::chain_second",
"tests::query_filters_dont_collide_with_fetches",
"schedule::schedule::tests::no_sync_chain::chain_first",
"tests::par_for_each_dense",
"schedule::schedule::tests::merges_sync_points_into_one",
"tests::query_optional_component_sparse_no_match",
"tests::query_single_component",
"tests::query_optional_component_sparse",
"tests::par_for_each_sparse",
"tests::ref_and_mut_query_panic - should panic",
"tests::random_access",
"tests::query_single_component_for_each",
"tests::query_optional_component_table",
"query::tests::par_iter_mut_change_detection",
"tests::remove",
"tests::query_sparse_component",
"tests::remove_tracking",
"schedule::tests::system_ordering::order_systems",
"tests::remove_missing",
"tests::reserve_and_spawn",
"tests::resource",
"tests::resource_scope",
"tests::reserve_entities_across_worlds",
"tests::sparse_set_add_remove_many",
"tests::stateful_query_handles_new_archetype",
"tests::spawn_batch",
"tests::take",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"world::entity_ref::tests::disjoint_access",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"tests::test_is_archetypal_size_hints",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::sorted_remove",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::entity_ref::tests::retain_nothing",
"world::entity_ref::tests::retain_some_components",
"world::identifier::tests::world_id_system_param",
"world::identifier::tests::world_ids_unique",
"world::tests::custom_resource_with_layout",
"world::identifier::tests::world_id_exclusive_system_param",
"world::tests::get_resource_by_id",
"world::tests::get_resource_mut_by_id",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::init_resource_does_not_overwrite",
"world::tests::iterate_entities_mut",
"world::tests::spawn_empty_bundle",
"world::tests::panic_while_overwriting_component",
"world::world_cell::tests::world_access_reused",
"world::world_cell::tests::world_cell",
"world::tests::inspect_entity_components",
"world::tests::iterate_entities",
"world::world_cell::tests::world_cell_double_mut - should panic",
"world::world_cell::tests::world_cell_mut_and_ref - should panic",
"world::world_cell::tests::world_cell_ref_and_ref",
"world::world_cell::tests::world_cell_ref_and_mut - should panic",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 862) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 810) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 125) - compile fail",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'w>::map_unchanged (line 854) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 202) - compile",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 95) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 212) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 34)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 94)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 436)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 15)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 826)",
"crates/bevy_ecs/src/component.rs - component::Component (line 81)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 83)",
"crates/bevy_ecs/src/lib.rs - (line 289)",
"crates/bevy_ecs/src/lib.rs - (line 191)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 188)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 24)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 111)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 536)",
"crates/bevy_ecs/src/component.rs - component::Component (line 100)",
"crates/bevy_ecs/src/lib.rs - (line 214)",
"crates/bevy_ecs/src/component.rs - component::Component (line 35)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 186)",
"crates/bevy_ecs/src/lib.rs - (line 76)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Ref (line 631)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 503)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 740)",
"crates/bevy_ecs/src/lib.rs - (line 32)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 211)",
"crates/bevy_ecs/src/component.rs - component::Component (line 135)",
"crates/bevy_ecs/src/lib.rs - (line 241)",
"crates/bevy_ecs/src/reflect/component.rs - reflect::component (line 16)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 100)",
"crates/bevy_ecs/src/lib.rs - (line 167)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 450)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 30)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::States (line 32)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Command (line 25)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 98)",
"crates/bevy_ecs/src/lib.rs - (line 256)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 105)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'w,T>::map_unchanged (line 615)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many (line 309)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 253)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 480)",
"crates/bevy_ecs/src/event.rs - event::EventReader<'w,'s,E>::is_empty (line 446)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 226)",
"crates/bevy_ecs/src/event.rs - event::Events (line 115)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 285)",
"crates/bevy_ecs/src/query/error.rs - query::error::QueryComponentError::MissingWriteAccess (line 64)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::in_state (line 710)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 123)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 333)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 556)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 281) - compile fail",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 560)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 212)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 559)",
"crates/bevy_ecs/src/lib.rs - (line 53)",
"crates/bevy_ecs/src/lib.rs - (line 93)",
"crates/bevy_ecs/src/lib.rs - (line 43)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::add (line 896)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 765)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'w,T>::map_unchanged (line 582)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_exists (line 663)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 190)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1152)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 133)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 241)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 538)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<D,F>::get_many_mut (line 379)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'w,T>::map_unchanged (line 796)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 349)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 80)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 382)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 34)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 380)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 338)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 97)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 594)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::QueryFilter (line 40)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 138)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::insert (line 710)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many (line 906) - compile",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 878)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::many_mut (line 1014) - compile",
"crates/bevy_ecs/src/query/error.rs - query::error::QueryComponentError::MissingReadAccess (line 33)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 969)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1129)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 101)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations_mut (line 513)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::try_insert (line 767)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_combinations (line 478)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 292)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 608)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 77)",
"crates/bevy_ecs/src/lib.rs - (line 126)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 381) - compile fail",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::id (line 684)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 508)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 176)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1396) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::retain (line 919)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 373)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 330)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 161)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 54)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 188)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::despawn (line 871)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1372)",
"crates/bevy_ecs/src/system/system_name.rs - system::system_name::SystemName (line 14)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 455)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 274)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 481)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 58)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 423)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::QueryData (line 131)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 392)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 477)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::remove (line 817)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 259)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 147)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 595)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 221)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_inner (line 1468)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter (line 411)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_changed (line 828)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 82)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 217)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 167)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 177)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_inner (line 1511)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_mut (line 447)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 922)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 666)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_exists_and_equals (line 762)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_component_mut (line 1127)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 118)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 211)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 269)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 114)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 62)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 144)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 352)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 114) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_mut (line 956)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 209)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 196)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_component (line 1090)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 903)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 102)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert_entry (line 1474)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::contains (line 1406)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 47)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single_mut (line 1310)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 174)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 579)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 861)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 242)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 219)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::for_each_mut (line 764)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 304)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get (line 1310)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 222)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 41)",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 24)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 236)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::is_empty (line 1376)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert_with (line 1251)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::insert_entry (line 1192)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many_mut (line 603)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::entry (line 1118)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 643)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 472)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 140)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get (line 838)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::take (line 1417)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 82)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single (line 1263)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 248)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::VacantEntry<'w,'a,T>::insert (line 1449)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::iter_many (line 546)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 174)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 46)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::get_mut (line 1337)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::into_mut (line 1370)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 154)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 246)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 1065)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::single (line 1235)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::get_single_mut (line 1340)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_insert (line 1222)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 309)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 201)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 318)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::OccupiedEntry<'w,'a,T>::insert (line 1394)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,D,F>::for_each (line 721)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 198)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 210)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 352)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 808)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::or_default (line 1277)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::Entry<'w,'a,T>::and_modify (line 1166)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 591)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 240)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 23)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 363)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 772)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 829)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2077)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 933)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 560)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 782)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 270)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1571)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 437)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 1000)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1453)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 650)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 683)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 969)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 10,627
|
bevyengine__bevy-10627
|
[
"10590"
] |
48d10e6d48d0a19ffa32aa195093bfcf8d3a5df0
|
diff --git a/crates/bevy_ecs/src/reflect/entity_commands.rs b/crates/bevy_ecs/src/reflect/entity_commands.rs
--- a/crates/bevy_ecs/src/reflect/entity_commands.rs
+++ b/crates/bevy_ecs/src/reflect/entity_commands.rs
@@ -189,15 +189,18 @@ fn insert_reflect(
type_registry: &TypeRegistry,
component: Box<dyn Reflect>,
) {
- let type_info = component.reflect_type_path();
+ let type_info = component
+ .get_represented_type_info()
+ .expect("component should represent a type.");
+ let type_path = type_info.type_path();
let Some(mut entity) = world.get_entity_mut(entity) else {
- panic!("error[B0003]: Could not insert a reflected component (of type {}) for entity {entity:?} because it doesn't exist in this World.", component.reflect_type_path());
+ panic!("error[B0003]: Could not insert a reflected component (of type {type_path}) for entity {entity:?} because it doesn't exist in this World.");
};
- let Some(type_registration) = type_registry.get_with_type_path(type_info) else {
- panic!("Could not get type registration (for component type {}) because it doesn't exist in the TypeRegistry.", component.reflect_type_path());
+ let Some(type_registration) = type_registry.get_with_type_path(type_path) else {
+ panic!("Could not get type registration (for component type {type_path}) because it doesn't exist in the TypeRegistry.");
};
let Some(reflect_component) = type_registration.data::<ReflectComponent>() else {
- panic!("Could not get ReflectComponent data (for component type {}) because it doesn't exist in this TypeRegistration.", component.reflect_type_path());
+ panic!("Could not get ReflectComponent data (for component type {type_path}) because it doesn't exist in this TypeRegistration.");
};
reflect_component.insert(&mut entity, &*component);
}
|
diff --git a/crates/bevy_ecs/src/reflect/entity_commands.rs b/crates/bevy_ecs/src/reflect/entity_commands.rs
--- a/crates/bevy_ecs/src/reflect/entity_commands.rs
+++ b/crates/bevy_ecs/src/reflect/entity_commands.rs
@@ -346,17 +349,22 @@ mod tests {
let mut commands = system_state.get_mut(&mut world);
let entity = commands.spawn_empty().id();
+ let entity2 = commands.spawn_empty().id();
let boxed_reflect_component_a = Box::new(ComponentA(916)) as Box<dyn Reflect>;
+ let boxed_reflect_component_a_clone = boxed_reflect_component_a.clone_value();
commands
.entity(entity)
.insert_reflect(boxed_reflect_component_a);
+ commands
+ .entity(entity2)
+ .insert_reflect(boxed_reflect_component_a_clone);
system_state.apply(&mut world);
assert_eq!(
world.entity(entity).get::<ComponentA>(),
- Some(&ComponentA(916))
+ world.entity(entity2).get::<ComponentA>()
);
}
|
`insert_reflect` panics when inserting component
## Bevy version
0.12.0
## What you did
Registered a type, create it from somewhere and then send it by event.
```rust
bullet_ec.insert_reflect(event.bullet_type.clone_value());
```
## What went wrong
```
thread 'main' panicked at T:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.12.0\src\reflect\entity_commands.rs:197:9:
Could not get type registration (for component type bevy_reflect::DynamicStruct) because it doesn't exist in the TypeRegistry.
```
## Additional information
You won't always get the real type path from `reflect_type_path`. The `clone_value()` overrides type info into "bevy_reflect::DynamicStruct".
```rust
println!("origin: {:?}, cloned: {:?}", bullet_type.reflect_type_path(), bullet_type.clone_value().reflect_type_path());
// prints
// origin: "rogue_shooting::bullets::LaneShot", cloned: "bevy_reflect::DynamicStruct"
```
One feasible workaround is [dyn-clone](https://docs.rs/dyn-clone/latest/dyn_clone/).
```rust
trait CloneReflect: Reflect + DynClone {}
dyn_clone::clone_trait_object!(CloneReflect);
```
Implement this for your component. They will be perfectly cloned now by using `.clone()`.
|
~~I also suspect `type_registration.data::<ReflectComponent>()` won't work, for it returns value from internal map by TypeId, which is never exists in `TypeRegistry` of any type.~~
I found this is because I missed `#[reflect(Component)]`
|
2023-11-18T09:11:55Z
|
0.12
|
2024-01-30T14:10:13Z
|
e6e25dead4d4b274e439f0050a2595b42b009dd2
|
[
"reflect::entity_commands::tests::insert_reflected"
] |
[
"change_detection::tests::map_mut",
"change_detection::tests::mut_from_non_send_mut",
"change_detection::tests::mut_new",
"change_detection::tests::mut_untyped_to_reflect",
"change_detection::tests::mut_from_res_mut",
"entity::map_entities::tests::entity_mapper",
"entity::map_entities::tests::world_scope_reserves_generations",
"change_detection::tests::as_deref_mut",
"change_detection::tests::set_if_neq",
"entity::tests::entity_comparison",
"entity::tests::entity_const",
"entity::tests::entity_bits_roundtrip",
"entity::tests::get_reserved_and_invalid",
"change_detection::tests::change_tick_scan",
"change_detection::tests::change_tick_wraparound",
"entity::tests::reserve_entity_len",
"change_detection::tests::change_expiration",
"entity::tests::reserve_generations",
"entity::tests::reserve_generations_and_alloc",
"event::tests::ensure_reader_readonly",
"event::tests::test_event_iter_len_updated",
"event::tests::test_event_iter_last",
"event::tests::test_event_reader_len_current",
"event::tests::test_event_reader_len_filled",
"event::tests::test_event_reader_clear",
"event::tests::test_event_reader_len_empty",
"event::tests::test_event_reader_len_update",
"event::tests::test_events",
"event::tests::test_events_clear_and_read",
"event::tests::test_events_empty",
"event::tests::test_events_drain_and_read",
"event::tests::test_events_extend_impl",
"event::tests::test_firing_empty_event",
"event::tests::test_send_events_ids",
"event::tests::test_update_drain",
"query::access::tests::access_get_conflicts",
"query::access::tests::filtered_access_extend",
"query::access::tests::filtered_access_extend_or",
"query::access::tests::filtered_combined_access",
"query::access::tests::read_all_access_conflicts",
"query::fetch::tests::world_query_metadata_collision",
"query::fetch::tests::read_only_field_visibility",
"query::fetch::tests::world_query_phantom_data",
"query::state::tests::get_many_unchecked_manual_uniqueness",
"query::fetch::tests::world_query_struct_variants",
"query::state::tests::right_world_get_many - should panic",
"query::state::tests::right_world_get_many_mut - should panic",
"query::state::tests::right_world_get - should panic",
"query::tests::any_query",
"query::tests::has_query",
"query::tests::multi_storage_query",
"query::tests::many_entities",
"query::tests::mut_to_immut_query_methods_have_immut_item",
"query::tests::query",
"query::tests::derived_worldqueries",
"query::tests::query_iter_combinations",
"query::tests::self_conflicting_worldquery - should panic",
"query::tests::query_iter_combinations_sparse",
"query::tests::query_filtered_iter_combinations",
"reflect::entity_commands::tests::remove_reflected",
"reflect::entity_commands::tests::insert_reflected_with_registry",
"schedule::condition::tests::distributive_run_if_compiles",
"reflect::entity_commands::tests::remove_reflected_with_registry",
"schedule::set::tests::test_derive_schedule_label",
"schedule::set::tests::test_derive_system_set",
"schedule::tests::schedule_build_errors::cross_dependency",
"schedule::tests::schedule_build_errors::configure_system_type_set - should panic",
"schedule::tests::schedule_build_errors::hierarchy_cycle",
"schedule::tests::schedule_build_errors::dependency_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_loop - should panic",
"schedule::tests::schedule_build_errors::hierarchy_redundancy",
"schedule::tests::schedule_build_errors::ambiguity",
"schedule::tests::system_ambiguity::ambiguous_with_label",
"schedule::tests::schedule_build_errors::sets_have_order_but_intersect",
"schedule::tests::schedule_build_errors::dependency_cycle",
"schedule::tests::system_ambiguity::components",
"schedule::tests::system_ambiguity::ignore_all_ambiguities",
"schedule::tests::system_ambiguity::ambiguous_with_system",
"schedule::tests::system_ambiguity::before_and_after",
"schedule::tests::system_ambiguity::nonsend",
"schedule::tests::system_ambiguity::anonymous_set_name",
"storage::blob_vec::tests::blob_vec_drop_empty_capacity",
"schedule::tests::system_ambiguity::resources",
"storage::blob_vec::tests::aligned_zst",
"schedule::tests::schedule_build_errors::system_type_set_ambiguity",
"storage::blob_vec::tests::resize_test",
"schedule::tests::system_ambiguity::one_of_everything",
"storage::blob_vec::tests::blob_vec",
"storage::sparse_set::tests::sparse_sets",
"storage::sparse_set::tests::sparse_set",
"schedule::tests::system_ambiguity::ignore_component_resource_ambiguities",
"system::commands::command_queue::test::test_command_is_send",
"schedule::tests::system_ambiguity::exclusive",
"storage::table::tests::table",
"system::commands::command_queue::test::test_command_queue_inner_drop",
"system::commands::command_queue::test::test_command_queue_inner",
"schedule::tests::system_ambiguity::read_world",
"system::commands::command_queue::test::test_command_queue_inner_panic_safe",
"schedule::tests::system_ambiguity::correct_ambiguities",
"schedule::tests::system_ambiguity::events",
"system::commands::tests::commands",
"system::commands::tests::remove_resources",
"system::system::tests::command_processing",
"system::system::tests::run_system_once",
"system::commands::tests::remove_components",
"system::system::tests::run_two_systems",
"system::system::tests::non_send_resources",
"system::system_param::tests::system_param_const_generics",
"system::system_param::tests::system_param_flexibility",
"system::system_param::tests::system_param_generic_bounds",
"system::system_param::tests::system_param_field_limit",
"system::system_param::tests::system_param_invariant_lifetime",
"system::system_param::tests::system_param_phantom_data",
"system::system_param::tests::system_param_where_clause",
"system::system_param::tests::system_param_name_collision",
"system::system_param::tests::system_param_private_fields",
"system::system_param::tests::system_param_struct_variants",
"system::system_registry::tests::change_detection",
"system::system_registry::tests::local_variables",
"system::system_registry::tests::input_values",
"schedule::tests::system_ambiguity::read_only",
"system::system_registry::tests::nested_systems",
"system::system_registry::tests::nested_systems_with_inputs",
"system::tests::get_system_conflicts",
"system::tests::conflicting_query_with_query_set_system - should panic",
"system::tests::any_of_has_no_filter_with - should panic",
"system::system_registry::tests::output_values",
"system::tests::assert_systems",
"system::tests::conflicting_system_resources_multiple_mutable - should panic",
"system::tests::assert_system_does_not_conflict - should panic",
"system::tests::conflicting_query_mut_system - should panic",
"system::tests::conflicting_system_resources - should panic",
"system::tests::long_life_test",
"system::tests::immutable_mut_test",
"system::tests::convert_mut_to_immut",
"system::tests::or_expanded_nested_with_and_disjoint_nested_without - should panic",
"system::tests::or_expanded_nested_or_with_and_disjoint_without - should panic",
"system::tests::conflicting_system_resources_reverse_order - should panic",
"system::tests::option_has_no_filter_with - should panic",
"system::tests::or_expanded_nested_with_and_disjoint_without - should panic",
"system::tests::conflicting_query_sets_system - should panic",
"system::tests::conflicting_query_immut_system - should panic",
"system::tests::can_have_16_parameters",
"system::tests::or_expanded_with_and_disjoint_nested_without - should panic",
"system::tests::or_has_no_filter_with - should panic",
"system::tests::read_system_state",
"system::tests::query_validates_world_id - should panic",
"system::tests::pipe_change_detection",
"system::tests::simple_system",
"system::tests::query_is_empty",
"system::tests::system_state_change_detection",
"system::tests::system_state_archetype_update",
"system::tests::system_state_invalid_world - should panic",
"system::tests::write_system_state",
"system::tests::with_and_disjoint_or_empty_without - should panic",
"tests::changed_query",
"tests::changed_trackers",
"tests::added_queries",
"tests::duplicate_components_panic - should panic",
"tests::despawn_table_storage",
"tests::despawn_mixed_storage",
"tests::empty_spawn",
"tests::bundle_derive",
"tests::clear_entities",
"tests::exact_size_query",
"tests::entity_ref_and_mut_query_panic - should panic",
"tests::add_remove_components",
"tests::insert_overwrite_drop_sparse",
"tests::insert_overwrite_drop",
"tests::changed_trackers_sparse",
"system::tests::update_archetype_component_access_works",
"tests::filtered_query_access",
"tests::mut_and_entity_ref_query_panic - should panic",
"tests::insert_or_spawn_batch_invalid",
"tests::insert_or_spawn_batch",
"tests::mut_and_mut_query_panic - should panic",
"tests::non_send_resource_drop_from_same_thread",
"tests::added_tracking",
"tests::non_send_resource_points_to_distinct_data",
"tests::multiple_worlds_same_query_iter - should panic",
"tests::query_all",
"tests::non_send_resource",
"tests::multiple_worlds_same_query_for_each - should panic",
"tests::mut_and_ref_query_panic - should panic",
"schedule::tests::system_ordering::order_exclusive_systems",
"system::tests::any_of_and_without",
"system::system_param::tests::non_sync_local",
"tests::multiple_worlds_same_query_get - should panic",
"system::system_param::tests::param_set_non_send_second",
"tests::query_filter_with",
"tests::non_send_resource_panic - should panic",
"schedule::schedule::tests::ambiguous_with_not_breaking_run_conditions",
"tests::query_all_for_each",
"tests::query_filter_with_for_each",
"tests::query_filter_with_sparse",
"tests::query_get",
"schedule::tests::system_execution::run_exclusive_system",
"tests::query_filter_with_sparse_for_each",
"system::tests::or_has_filter_with",
"tests::query_get_works_across_sparse_removal",
"tests::query_filters_dont_collide_with_fetches",
"system::tests::any_of_doesnt_remove_unrelated_filter_with",
"system::tests::or_has_filter_with_when_both_have_it",
"tests::query_filter_without",
"system::system_param::tests::param_set_non_send_first",
"schedule::tests::conditions::multiple_conditions_on_system_sets",
"tests::query_missing_component",
"system::tests::any_of_has_filter_with_when_both_have_it",
"tests::query_optional_component_sparse",
"tests::query_optional_component_sparse_no_match",
"tests::non_send_resource_drop_from_different_thread - should panic",
"system::tests::non_send_option_system",
"schedule::tests::conditions::system_with_condition",
"tests::query_single_component",
"tests::query_sparse_component",
"tests::query_optional_component_table",
"tests::query_single_component_for_each",
"system::tests::nonconflicting_system_resources",
"system::tests::option_doesnt_remove_unrelated_filter_with",
"system::tests::or_expanded_with_and_without_common",
"system::tests::or_with_without_and_compatible_with_without",
"tests::ref_and_mut_query_panic - should panic",
"tests::random_access",
"system::tests::readonly_query_get_mut_component_fails",
"system::tests::or_expanded_nested_with_and_without_common",
"system::tests::disjoint_query_mut_system",
"system::tests::world_collections_system",
"system::tests::non_send_system",
"tests::remove",
"system::tests::local_system",
"tests::resource",
"tests::resource_scope",
"system::tests::or_expanded_nested_with_and_common_nested_without",
"event::tests::test_event_iter_nth",
"tests::reserve_entities_across_worlds",
"schedule::tests::conditions::multiple_conditions_on_system",
"schedule::tests::system_execution::run_system",
"tests::reserve_and_spawn",
"system::tests::into_iter_impl",
"tests::stateful_query_handles_new_archetype",
"tests::remove_missing",
"tests::remove_tracking",
"system::tests::disjoint_query_mut_read_component_system",
"system::tests::query_system_gets",
"system::tests::or_param_set_system",
"system::tests::panic_inside_system - should panic",
"world::entity_ref::tests::despawning_entity_updates_archetype_row",
"schedule::condition::tests::multiple_run_conditions_is_and_operation",
"system::tests::or_doesnt_remove_unrelated_filter_with",
"schedule::tests::conditions::system_set_conditions_and_change_detection",
"world::entity_ref::tests::despawning_entity_updates_table_row",
"schedule::tests::system_ordering::add_systems_correct_order",
"system::tests::test_combinator_clone",
"system::tests::query_set_system",
"tests::spawn_batch",
"system::tests::commands_param_set",
"schedule::tests::conditions::run_exclusive_system_with_condition",
"schedule::set::tests::test_schedule_label",
"schedule::tests::conditions::systems_nested_in_system_sets",
"world::entity_ref::tests::entity_mut_insert_bundle_by_id",
"world::entity_ref::tests::entity_ref_get_by_id_invalid_component_id",
"schedule::tests::conditions::systems_with_distributive_condition",
"tests::sparse_set_add_remove_many",
"world::entity_ref::tests::entity_mut_get_by_id",
"world::entity_ref::tests::entity_mut_get_by_id_invalid_component_id",
"world::entity_ref::tests::inserting_dense_updates_archetype_row",
"tests::take",
"world::entity_ref::tests::disjoint_access",
"schedule::condition::tests::run_condition_combinators",
"world::entity_ref::tests::inserting_sparse_updates_archetype_row",
"world::entity_ref::tests::mut_compatible_with_entity",
"schedule::condition::tests::multiple_run_conditions",
"world::entity_ref::tests::entity_mut_world_scope_panic",
"schedule::tests::system_ordering::add_systems_correct_order_nested",
"system::tests::removal_tracking",
"tests::test_is_archetypal_size_hints",
"schedule::tests::conditions::mixed_conditions_and_change_detection",
"world::entity_ref::tests::inserting_dense_updates_table_row",
"world::entity_ref::tests::ref_compatible",
"world::entity_ref::tests::entity_mut_insert_by_id",
"world::entity_ref::tests::entity_ref_get_by_id",
"schedule::condition::tests::run_condition",
"world::entity_ref::tests::ref_compatible_with_resource",
"world::entity_ref::tests::mut_incompatible_with_read_only_query - should panic",
"world::entity_ref::tests::mut_incompatible_with_mutable_query - should panic",
"system::tests::changed_resource_system",
"schedule::tests::conditions::system_conditions_and_change_detection",
"world::entity_ref::tests::mut_incompatible_with_mutable_component - should panic",
"tests::par_for_each_dense",
"world::entity_ref::tests::ref_incompatible_with_mutable_component - should panic",
"world::entity_ref::tests::sorted_remove",
"tests::par_for_each_sparse",
"world::entity_ref::tests::removing_dense_updates_table_row",
"world::entity_ref::tests::removing_sparse_updates_archetype_row",
"world::tests::custom_resource_with_layout",
"world::tests::get_resource_by_id",
"world::entity_ref::tests::mut_incompatible_with_read_only_component - should panic",
"world::entity_ref::tests::ref_incompatible_with_mutable_query - should panic",
"world::tests::get_resource_mut_by_id",
"world::identifier::tests::world_ids_unique",
"query::tests::query_filtered_exactsizeiterator_len",
"world::tests::init_non_send_resource_does_not_overwrite",
"world::tests::spawn_empty_bundle",
"world::tests::iterate_entities_mut",
"world::world_cell::tests::world_access_reused",
"world::tests::iterate_entities",
"world::tests::inspect_entity_components",
"query::tests::par_iter_mut_change_detection",
"world::tests::init_resource_does_not_overwrite",
"world::world_cell::tests::world_cell",
"schedule::tests::system_ordering::order_systems",
"world::tests::panic_while_overwriting_component",
"world::world_cell::tests::world_cell_ref_and_mut - should panic",
"world::world_cell::tests::world_cell_mut_and_ref - should panic",
"world::world_cell::tests::world_cell_ref_and_ref",
"world::world_cell::tests::world_cell_double_mut - should panic",
"system::tests::get_many_is_ordered",
"schedule::tests::system_execution::parallel_execution",
"tests::table_add_remove_many",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'a>::map_unchanged (line 840) - compile",
"crates/bevy_ecs/src/component.rs - component::ComponentTicks::set_changed (line 816) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::MutUntyped<'a>::map_unchanged (line 832) - compile",
"crates/bevy_ecs/src/component.rs - component::Component (line 125) - compile fail",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 101) - compile fail",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 169) - compile",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity::PLACEHOLDER (line 159) - compile",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChanges (line 34)",
"crates/bevy_ecs/src/component.rs - component::Component (line 100)",
"crates/bevy_ecs/src/component.rs - component::StorageType (line 188)",
"crates/bevy_ecs/src/lib.rs - (line 243)",
"crates/bevy_ecs/src/entity/map_entities.rs - entity::map_entities::MapEntities (line 15)",
"crates/bevy_ecs/src/lib.rs - (line 291)",
"crates/bevy_ecs/src/lib.rs - (line 169)",
"crates/bevy_ecs/src/lib.rs - (line 34)",
"crates/bevy_ecs/src/bundle.rs - bundle::Bundle (line 94)",
"crates/bevy_ecs/src/lib.rs - (line 216)",
"crates/bevy_ecs/src/component.rs - component::ComponentIdFor (line 832)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 192)",
"crates/bevy_ecs/src/component.rs - component::Component (line 35)",
"crates/bevy_ecs/src/lib.rs - (line 193)",
"crates/bevy_ecs/src/component.rs - component::Component (line 135)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 256)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 217)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut (line 83)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 507)",
"crates/bevy_ecs/src/component.rs - component::Component (line 81)",
"crates/bevy_ecs/src/query/iter.rs - query::iter::QueryCombinationIter (line 242)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::remove_reflect (line 100)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 117)",
"crates/bevy_ecs/src/reflect/entity_commands.rs - reflect::entity_commands::ReflectCommandExt::insert_reflect (line 30)",
"crates/bevy_ecs/src/lib.rs - (line 78)",
"crates/bevy_ecs/src/schedule/state.rs - schedule::state::States (line 31)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Command (line 25)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 98)",
"crates/bevy_ecs/src/component.rs - component::Components::resource_id (line 598)",
"crates/bevy_ecs/src/event.rs - event::Events (line 115)",
"crates/bevy_ecs/src/query/error.rs - query::error::QueryComponentError::MissingWriteAccess (line 64)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 77)",
"crates/bevy_ecs/src/lib.rs - (line 45)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Added (line 555)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 245)",
"crates/bevy_ecs/src/event.rs - event::EventWriter (line 489)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1293)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::With (line 24)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 18)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 60)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<Q,F>::get_many (line 309)",
"crates/bevy_ecs/src/entity/mod.rs - entity::Entity (line 97)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Or (line 230)",
"crates/bevy_ecs/src/lib.rs - (line 55)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Without (line 125)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 137)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::Has (line 1270)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands (line 80)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::NonSendMut<'a,T>::map_unchanged (line 615)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::not (line 953)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::add (line 554)",
"crates/bevy_ecs/src/component.rs - component::Components::component_id (line 558)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_read_only_system (line 500) - compile fail",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::insert (line 705)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::entity (line 280)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::Mut<'a,T>::map_unchanged (line 774)",
"crates/bevy_ecs/src/removal_detection.rs - removal_detection::RemovedComponents (line 123)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::replace_if_neq (line 188)",
"crates/bevy_ecs/src/query/state.rs - query::state::QueryState<Q,F>::get_many_mut (line 379)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_removed (line 592)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::get_entity (line 333)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_changed (line 461)",
"crates/bevy_ecs/src/query/fetch.rs - query::fetch::WorldQuery (line 280)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn (line 221)",
"crates/bevy_ecs/src/query/filter.rs - query::filter::Changed (line 591)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::init_resource (line 450)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::ResMut<'a,T>::map_unchanged (line 582)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::id (line 679)",
"crates/bevy_ecs/src/change_detection.rs - change_detection::DetectChangesMut::set_if_neq (line 138)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::on_event (line 862)",
"crates/bevy_ecs/src/event.rs - event::EventReader<'w,'s,E>::is_empty (line 455)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::add (line 889)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed (line 407)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::any_with_component (line 906)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::remove_resource (line 503)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_batch (line 375)",
"crates/bevy_ecs/src/lib.rs - (line 95)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::distributive_run_if (line 283)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::spawn_empty (line 156)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::Commands<'w,'s>::insert_resource (line 476)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition (line 42)",
"crates/bevy_ecs/src/system/adapter_system.rs - system::adapter_system::Adapt (line 10)",
"crates/bevy_ecs/src/query/error.rs - query::error::QueryComponentError::MissingReadAccess (line 33)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::many_mut (line 1001) - compile",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::many (line 893) - compile",
"crates/bevy_ecs/src/system/commands/parallel_scope.rs - system::commands::parallel_scope::ParallelCommands (line 24)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::try_insert (line 762)",
"crates/bevy_ecs/src/lib.rs - (line 258)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs::run_if (line 316)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::remove (line 815)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_equals (line 276)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 383) - compile fail",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_changed (line 812)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 66)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1461) - compile fail",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_combinations_mut (line 511)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_added (line 357)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_combinations (line 476)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists_and_equals (line 314)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_exists (line 237)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::PipeSystem (line 270)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::or_else (line 117)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_exists (line 647)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::state_exists_and_equals (line 746)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 394)",
"crates/bevy_ecs/src/schedule/config.rs - schedule::config::IntoSystemConfigs (line 216)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::StaticSystemParam (line 1437)",
"crates/bevy_ecs/src/system/combinator.rs - system::combinator::Combine (line 20)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::resource_changed_or_removed (line 522)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::in_state (line 694)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 178)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommands<'w,'s,'a>::despawn (line 864)",
"crates/bevy_ecs/src/lib.rs - (line 128)",
"crates/bevy_ecs/src/system/commands/mod.rs - system::commands::EntityCommand (line 590)",
"crates/bevy_ecs/src/schedule/schedule.rs - schedule::schedule::Schedule (line 164)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::Condition::and_then (line 85)",
"crates/bevy_ecs/src/schedule/condition.rs - schedule::condition::common_conditions::run_once (line 196)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemParamFunction (line 560)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::new (line 245)",
"crates/bevy_ecs/src/system/mod.rs - system (line 56)",
"crates/bevy_ecs/src/system/mod.rs - system::In (line 218)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 39)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 116)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::for_each (line 717)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_component (line 1077)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 209)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 100)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 142)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 165)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get (line 825)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell<'w>::world_mut (line 114) - compile",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem (line 139)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_component_mut (line 1114)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 133)",
"crates/bevy_ecs/src/system/mod.rs - system::assert_is_system (line 467)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 80)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_inner (line 1498)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::single (line 1222)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::warn (line 362)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_single_mut (line 1327)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 219)",
"crates/bevy_ecs/src/system/mod.rs - system::IntoSystem::map (line 173)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter (line 409)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::info (line 306)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_many_mut (line 601)",
"crates/bevy_ecs/src/system/function_system.rs - system::function_system::SystemState (line 100)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_single (line 1250)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 242)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::error (line 392)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 271)",
"crates/bevy_ecs/src/world/unsafe_world_cell.rs - world::unsafe_world_cell::UnsafeWorldCell (line 47)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_mut (line 445)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::single_mut (line 1297)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::ignore (line 424)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityWorldMut<'w>::world_scope (line 989)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 60)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::for_each_mut (line 756)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 154)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Resource (line 354)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityMut (line 201)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 669)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::SystemParam (line 46)",
"crates/bevy_ecs/src/world/mod.rs - world::World::clear_trackers (line 897)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_inner (line 1455)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity (line 437)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 206)",
"crates/bevy_ecs/src/system/mod.rs - system (line 13)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::iter_many (line 544)",
"crates/bevy_ecs/src/world/entity_ref.rs - world::entity_ref::EntityRef (line 23)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::dbg (line 334)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::is_empty (line 1363)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 198)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 219)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity (line 236)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::contains (line 1393)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Local (line 646)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::ParamSet (line 306)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query (line 194)",
"crates/bevy_ecs/src/world/mod.rs - world::World::despawn (line 855)",
"crates/bevy_ecs/src/world/mod.rs - world::World::entity_mut (line 270)",
"crates/bevy_ecs/src/system/query.rs - system::query::Query<'w,'s,Q,F>::get_mut (line 943)",
"crates/bevy_ecs/src/system/mod.rs - system::adapter::unwrap (line 274)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_entity_mut (line 560)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities (line 472)",
"crates/bevy_ecs/src/system/system_param.rs - system::system_param::Deferred (line 775)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 239)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get (line 808)",
"crates/bevy_ecs/src/system/system.rs - system::system::RunSystemOnce (line 174)",
"crates/bevy_ecs/src/world/mod.rs - world::World::component_id (line 210)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system (line 174)",
"crates/bevy_ecs/src/system/system_registry.rs - system::system_registry::World::run_system_with_input (line 246)",
"crates/bevy_ecs/src/world/mod.rs - world::World::insert_or_spawn_batch (line 1411)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 363)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_many_entities_mut (line 591)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 927)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 309)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities_mut (line 352)",
"crates/bevy_ecs/src/world/mod.rs - world::World::get_mut (line 829)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query_filtered (line 994)",
"crates/bevy_ecs/src/world/mod.rs - world::World::resource_scope (line 1529)",
"crates/bevy_ecs/src/world/mod.rs - world::World::many_entities (line 318)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_batch (line 782)",
"crates/bevy_ecs/src/world/mod.rs - world::World::query (line 963)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn (line 683)",
"crates/bevy_ecs/src/world/mod.rs - world::World::spawn_empty (line 650)",
"crates/bevy_ecs/src/world/mod.rs - world::World::schedule_scope (line 2035)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 10,103
|
bevyengine__bevy-10103
|
[
"10086"
] |
88599d7fa06dff6bba434f3a91b57bf8f483f158
|
diff --git a/crates/bevy_reflect/src/serde/ser.rs b/crates/bevy_reflect/src/serde/ser.rs
--- a/crates/bevy_reflect/src/serde/ser.rs
+++ b/crates/bevy_reflect/src/serde/ser.rs
@@ -68,7 +68,22 @@ impl<'a> Serialize for ReflectSerializer<'a> {
{
let mut state = serializer.serialize_map(Some(1))?;
state.serialize_entry(
- self.value.reflect_type_path(),
+ self.value
+ .get_represented_type_info()
+ .ok_or_else(|| {
+ if self.value.is_dynamic() {
+ Error::custom(format_args!(
+ "cannot serialize dynamic value without represented type: {}",
+ self.value.reflect_type_path()
+ ))
+ } else {
+ Error::custom(format_args!(
+ "cannot get type info for {}",
+ self.value.reflect_type_path()
+ ))
+ }
+ })?
+ .type_path(),
&TypedReflectSerializer::new(self.value, self.registry),
)?;
state.end()
diff --git a/crates/bevy_reflect/src/type_path.rs b/crates/bevy_reflect/src/type_path.rs
--- a/crates/bevy_reflect/src/type_path.rs
+++ b/crates/bevy_reflect/src/type_path.rs
@@ -183,6 +183,10 @@ impl fmt::Debug for TypePathTable {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("TypePathVtable")
.field("type_path", &self.type_path)
+ .field("short_type_path", &(self.short_type_path)())
+ .field("type_ident", &(self.type_ident)())
+ .field("crate_name", &(self.crate_name)())
+ .field("module_path", &(self.module_path)())
.finish()
}
}
|
diff --git a/crates/bevy_reflect/src/serde/mod.rs b/crates/bevy_reflect/src/serde/mod.rs
--- a/crates/bevy_reflect/src/serde/mod.rs
+++ b/crates/bevy_reflect/src/serde/mod.rs
@@ -8,7 +8,7 @@ pub use type_data::*;
#[cfg(test)]
mod tests {
- use crate::{self as bevy_reflect, DynamicTupleStruct};
+ use crate::{self as bevy_reflect, DynamicTupleStruct, Struct};
use crate::{
serde::{ReflectSerializer, UntypedReflectDeserializer},
type_registry::TypeRegistry,
diff --git a/crates/bevy_reflect/src/serde/mod.rs b/crates/bevy_reflect/src/serde/mod.rs
--- a/crates/bevy_reflect/src/serde/mod.rs
+++ b/crates/bevy_reflect/src/serde/mod.rs
@@ -94,8 +94,10 @@ mod tests {
}
#[test]
- #[should_panic(expected = "cannot get type info for bevy_reflect::DynamicStruct")]
- fn unproxied_dynamic_should_not_serialize() {
+ #[should_panic(
+ expected = "cannot serialize dynamic value without represented type: bevy_reflect::DynamicStruct"
+ )]
+ fn should_not_serialize_unproxied_dynamic() {
let registry = TypeRegistry::default();
let mut value = DynamicStruct::default();
diff --git a/crates/bevy_reflect/src/serde/mod.rs b/crates/bevy_reflect/src/serde/mod.rs
--- a/crates/bevy_reflect/src/serde/mod.rs
+++ b/crates/bevy_reflect/src/serde/mod.rs
@@ -104,4 +106,36 @@ mod tests {
let serializer = ReflectSerializer::new(&value, ®istry);
ron::ser::to_string(&serializer).unwrap();
}
+
+ #[test]
+ fn should_roundtrip_proxied_dynamic() {
+ #[derive(Reflect)]
+ struct TestStruct {
+ a: i32,
+ b: i32,
+ }
+
+ let mut registry = TypeRegistry::default();
+ registry.register::<TestStruct>();
+
+ let value: DynamicStruct = TestStruct { a: 123, b: 456 }.clone_dynamic();
+
+ let serializer = ReflectSerializer::new(&value, ®istry);
+
+ let expected = r#"{"bevy_reflect::serde::tests::TestStruct":(a:123,b:456)}"#;
+ let result = ron::ser::to_string(&serializer).unwrap();
+ assert_eq!(expected, result);
+
+ let mut deserializer = ron::de::Deserializer::from_str(&result).unwrap();
+ let reflect_deserializer = UntypedReflectDeserializer::new(®istry);
+
+ let expected = value.clone_value();
+ let result = reflect_deserializer
+ .deserialize(&mut deserializer)
+ .unwrap()
+ .take::<DynamicStruct>()
+ .unwrap();
+
+ assert!(expected.reflect_partial_eq(&result).unwrap());
+ }
}
|
Potential reflect issue: DynamicStruct not registered
## Bevy version
version: current main branch
## What you did
While migrating my crate to the current bevy main, I am facing the current error: "No registration found for bevy_reflect::DynamicStruct" when deserializing a reflected component.
This worked in bevy 0.11.
The current branch where I'm working, and my test failing is: https://github.com/raffaeleragni/bevy_sync/blob/bevy_0_12/src/proto_serde.rs#L122
|
@MrGVSV I don't follow exactly what's going on / broke here, but this looks like a regression.
Yeah this seems to be an issue with the recent changes to how `TypePath` is used in the reflection serializer. I'll make a PR!
|
2023-10-12T23:39:42Z
|
1.70
|
2023-10-17T00:03:37Z
|
6f27e0e35faffbf2b77807bb222d3d3a9a529210
|
[
"serde::tests::should_not_serialize_unproxied_dynamic - should panic",
"serde::tests::should_roundtrip_proxied_dynamic"
] |
[
"enums::tests::enum_should_return_correct_variant_type",
"enums::tests::enum_should_allow_generics",
"enums::tests::enum_should_return_correct_variant_path",
"enums::tests::enum_should_allow_struct_fields",
"impls::smol_str::tests::should_partial_eq_smolstr",
"enums::tests::enum_should_allow_nesting_enums",
"enums::tests::enum_should_partial_eq",
"enums::tests::enum_should_iterate_fields",
"enums::tests::enum_should_apply",
"enums::tests::partial_dynamic_enum_should_set_variant_fields",
"enums::tests::enum_should_set",
"impls::smol_str::tests::smolstr_should_from_reflect",
"impls::std::tests::option_should_impl_typed",
"impls::std::tests::path_should_from_reflect",
"impls::std::tests::option_should_impl_enum",
"impls::std::tests::can_serialize_duration",
"impls::std::tests::instant_should_from_reflect",
"impls::std::tests::nonzero_usize_impl_reflect_from_reflect",
"impls::std::tests::option_should_apply",
"impls::std::tests::should_partial_eq_char",
"impls::std::tests::option_should_from_reflect",
"enums::tests::should_skip_ignored_fields",
"impls::std::tests::should_partial_eq_f32",
"enums::tests::dynamic_enum_should_change_variant",
"enums::tests::applying_non_enum_should_panic - should panic",
"impls::std::tests::should_partial_eq_hash_map",
"enums::tests::dynamic_enum_should_apply_dynamic_enum",
"enums::tests::should_get_enum_type_info",
"list::tests::test_into_iter",
"map::tests::test_map_get_at",
"path::tests::accept_leading_tokens",
"impls::std::tests::should_partial_eq_i32",
"path::parse::test::parse_invalid",
"map::tests::test_map_get_at_mut",
"impls::std::tests::should_partial_eq_vec",
"path::tests::parsed_path_get_field",
"enums::tests::dynamic_enum_should_set_variant_fields",
"impls::std::tests::should_partial_eq_string",
"map::tests::test_into_iter",
"impls::std::tests::should_partial_eq_option",
"path::tests::reflect_array_behaves_like_list_mut",
"path::tests::reflect_array_behaves_like_list",
"tests::custom_debug_function",
"tests::docstrings::should_not_contain_docs",
"tests::as_reflect",
"tests::docstrings::should_contain_docs",
"path::tests::parsed_path_parse",
"tests::docstrings::fields_should_contain_docs",
"tests::from_reflect_should_use_default_field_attributes",
"tests::glam::vec3_path_access",
"tests::into_reflect",
"tests::multiple_reflect_lists",
"tests::not_dynamic_names",
"tests::recursive_typed_storage_does_not_hang",
"tests::reflect_struct",
"path::tests::reflect_path",
"tests::reflect_downcast",
"serde::ser::tests::should_serialize_option",
"tests::reflect_map_no_hash - should panic",
"tests::glam::vec3_field_access",
"tests::glam::quat_serialization",
"tests::glam::quat_deserialization",
"tests::from_reflect_should_use_default_variant_field_attributes",
"serde::ser::tests::should_serialize_non_self_describing_binary",
"tests::multiple_reflect_value_lists",
"tests::reflect_complex_patch",
"tests::glam::vec3_apply_dynamic",
"tests::reflect_ignore",
"tests::reflect_take",
"tests::should_permit_higher_ranked_lifetimes",
"tests::should_call_from_reflect_dynamically",
"tests::reflect_type_info",
"tests::reflect_type_path",
"tests::should_drain_fields",
"tests::reflect_map",
"tests::from_reflect_should_use_default_container_attribute",
"serde::ser::tests::should_serialize",
"tests::glam::vec3_serialization",
"type_uuid::test::test_generic_type_unique_uuid",
"tests::reflect_serialize",
"tests::should_reflect_debug",
"type_uuid::test::test_inverted_generic_type_unique_uuid",
"tests::should_prohibit_invalid_represented_type_for_dynamic - should panic",
"type_uuid::test::test_multiple_generic_uuid",
"type_uuid::test::test_generic_type_uuid_derive",
"type_uuid::test::test_primitive_generic_uuid",
"type_uuid::test::test_generic_type_uuid_same_for_eq_param",
"type_registry::test::test_reflect_from_ptr",
"tests::should_permit_valid_represented_type_for_dynamic",
"serde::de::tests::should_deserialize_value",
"tests::docstrings::variants_should_contain_docs",
"tests::reflect_unit_struct",
"tests::std_type_paths",
"serde::ser::tests::should_serialize_self_describing_binary",
"serde::de::tests::should_deserialized_typed",
"serde::de::tests::enum_should_deserialize",
"tests::can_opt_out_type_path",
"serde::tests::test_serialization_struct",
"serde::ser::tests::enum_should_serialize",
"serde::tests::test_serialization_tuple_struct",
"tests::glam::vec3_deserialization",
"serde::de::tests::should_deserialize_non_self_describing_binary",
"serde::de::tests::should_deserialize",
"serde::de::tests::should_deserialize_option",
"serde::de::tests::should_deserialize_self_describing_binary",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Struct (line 41)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Unit (line 28)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Tuple (line 51)",
"crates/bevy_reflect/src/lib.rs - (line 288)",
"crates/bevy_reflect/src/utility.rs - utility::NonGenericTypeCell (line 50)",
"crates/bevy_reflect/src/lib.rs - (line 31)",
"crates/bevy_reflect/src/type_info.rs - type_info::Typed (line 26)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Struct (line 10)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantType::Tuple (line 20)",
"crates/bevy_reflect/src/enums/variants.rs - enums::variants::VariantInfo::Unit (line 59)",
"crates/bevy_reflect/src/type_path.rs - type_path::TypePath (line 39)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 165)",
"crates/bevy_reflect/src/utility.rs - utility::GenericTypeCell (line 125)",
"crates/bevy_reflect/src/tuple.rs - tuple::tuple_debug (line 434)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::TupleStruct (line 21)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 140)",
"crates/bevy_reflect/src/array.rs - array::Array (line 30)",
"crates/bevy_reflect/src/lib.rs - (line 306)",
"crates/bevy_reflect/src/tuple.rs - tuple::GetTupleField (line 95)",
"crates/bevy_reflect/src/lib.rs - (line 267)",
"crates/bevy_reflect/src/lib.rs - (line 98)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 57)",
"crates/bevy_reflect/src/list.rs - list::List (line 37)",
"crates/bevy_reflect/src/lib.rs - (line 208)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::tuple_struct_debug (line 428)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::Struct (line 25)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::struct_debug (line 528)",
"crates/bevy_reflect/src/lib.rs - (line 239)",
"crates/bevy_reflect/src/list.rs - list::list_debug (line 481)",
"crates/bevy_reflect/src/tuple_struct.rs - tuple_struct::GetTupleStructField (line 175)",
"crates/bevy_reflect/src/struct_trait.rs - struct_trait::GetField (line 224)",
"crates/bevy_reflect/src/lib.rs - (line 183)",
"crates/bevy_reflect/src/lib.rs - (line 169)",
"crates/bevy_reflect/src/map.rs - map::map_debug (line 474)",
"crates/bevy_reflect/src/tuple.rs - tuple::Tuple (line 24)",
"crates/bevy_reflect/src/lib.rs - (line 134)",
"crates/bevy_reflect/src/enums/helpers.rs - enums::helpers::enum_debug (line 82)",
"crates/bevy_reflect/src/lib.rs - (line 148)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::ReflectFromPtr (line 505)",
"crates/bevy_reflect/src/map.rs - map::Map (line 29)",
"crates/bevy_reflect/src/lib.rs - (line 77)",
"crates/bevy_reflect/src/path/mod.rs - path::ParsedPath::parse (line 306)",
"crates/bevy_reflect/src/from_reflect.rs - from_reflect::ReflectFromReflect (line 77)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 176)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistration (line 310)",
"crates/bevy_reflect/src/enums/dynamic_enum.rs - enums::dynamic_enum::DynamicEnum (line 54)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 206)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 117)",
"crates/bevy_reflect/src/type_registry.rs - type_registry::TypeRegistry::register_type_data (line 146)",
"crates/bevy_reflect/src/path/mod.rs - path::GetPath (line 154)",
"crates/bevy_reflect/src/array.rs - array::array_debug (line 437)",
"crates/bevy_reflect/src/lib.rs - (line 349)"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 9,551
|
bevyengine__bevy-9551
|
[
"9550"
] |
8edcd8285d27cc16a7052cdb55f9bae85e0b1a2f
|
diff --git a/crates/bevy_derive/src/derefs.rs b/crates/bevy_derive/src/derefs.rs
--- a/crates/bevy_derive/src/derefs.rs
+++ b/crates/bevy_derive/src/derefs.rs
@@ -68,10 +68,12 @@ fn get_deref_field(ast: &DeriveInput, is_mut: bool) -> syn::Result<(Member, &Typ
let mut selected_field: Option<(Member, &Type)> = None;
for (index, field) in data_struct.fields.iter().enumerate() {
for attr in &field.attrs {
- if !attr.meta.require_path_only()?.is_ident(DEREF_ATTR) {
+ if !attr.meta.path().is_ident(DEREF_ATTR) {
continue;
}
+ attr.meta.require_path_only()?;
+
if selected_field.is_some() {
return Err(syn::Error::new_spanned(
attr,
|
diff --git a/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs b/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs
--- a/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs
+++ b/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs
@@ -5,9 +5,13 @@ struct TupleStruct(usize, #[deref] String);
#[derive(Deref)]
struct Struct {
+ // Works with other attributes
+ #[cfg(test)]
foo: usize,
#[deref]
bar: String,
+ /// Also works with doc comments.
+ baz: i32,
}
fn main() {
diff --git a/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs b/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs
--- a/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs
+++ b/crates/bevy_macros_compile_fail_tests/tests/deref_derive/multiple_fields.pass.rs
@@ -15,8 +19,10 @@ fn main() {
let _: &String = &*value;
let value = Struct {
+ #[cfg(test)]
foo: 123,
bar: "Hello world!".to_string(),
+ baz: 321,
};
let _: &String = &*value;
}
|
`#[deref]` fails when properties have other attributes or doc comments: "unexpected token in attribute"
## Bevy version
0.11.2
## What you did
I have a struct with several properties and would like to use the `#[deref]` attribute for one of them.
However, this doesn't work if any of the struct's fields have documentation comments or other attributes.
Minimal reproduction:
```rust
#[derive(Component, Deref, DerefMut)]
struct MyComponent {
#[deref]
foo: bool,
/// Important documentation. (throws error)
pub bar: bool,
}
```
## What went wrong
I get the error `unexpected token in attribute`. The publicity or type of the properties doesn't seem to matter, and I think it happens with all attribute types.
## Additional information
My use case for this is bevy_xpbd's components like `ExternalForce`. It has multiple documented fields, but I want to deref the actual force property so that you can do e.g. `*force = Vec3::Y` instead of `force.force = Vec3::Y`. I can do (and currently do) this manually, but for ergonomics it would be nice if `#[deref]` worked properly.
|
Replicated! I'll post a fix shortly
|
2023-08-23T20:11:45Z
|
1.70
|
2023-08-29T06:28:56Z
|
6f27e0e35faffbf2b77807bb222d3d3a9a529210
|
[
"tests/deref_derive/multiple_fields.pass.rs [should pass]"
] |
[
"tests/deref_derive/invalid_attribute.fail.rs [should fail to compile]",
"tests/deref_derive/invalid_item.fail.rs [should fail to compile]",
"tests/deref_derive/missing_attribute.fail.rs [should fail to compile]",
"tests/deref_derive/multiple_attributes.fail.rs [should fail to compile]",
"tests/deref_derive/single_field.pass.rs [should pass]",
"test",
"tests/deref_mut_derive/invalid_attribute.fail.rs [should fail to compile]",
"tests/deref_mut_derive/invalid_item.fail.rs [should fail to compile]",
"tests/deref_mut_derive/mismatched_target_type.fail.rs [should fail to compile]",
"tests/deref_mut_derive/missing_attribute.fail.rs [should fail to compile]",
"tests/deref_mut_derive/missing_deref.fail.rs [should fail to compile]",
"tests/deref_mut_derive/multiple_attributes.fail.rs [should fail to compile]",
"tests/deref_mut_derive/multiple_fields.pass.rs [should pass]",
"tests/deref_mut_derive/single_field.pass.rs [should pass]"
] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 9,530
|
bevyengine__bevy-9530
|
[
"751"
] |
5bcc100d108b1b49d7c505682236520ad54797ec
|
diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs
--- a/crates/bevy_app/src/plugin_group.rs
+++ b/crates/bevy_app/src/plugin_group.rs
@@ -66,13 +66,25 @@ impl PluginGroupBuilder {
// Insert the new plugin as enabled, and removes its previous ordering if it was
// already present
fn upsert_plugin_state<T: Plugin>(&mut self, plugin: T, added_at_index: usize) {
- if let Some(entry) = self.plugins.insert(
+ self.upsert_plugin_entry_state(
TypeId::of::<T>(),
PluginEntry {
plugin: Box::new(plugin),
enabled: true,
},
- ) {
+ added_at_index,
+ );
+ }
+
+ // Insert the new plugin entry as enabled, and removes its previous ordering if it was
+ // already present
+ fn upsert_plugin_entry_state(
+ &mut self,
+ key: TypeId,
+ plugin: PluginEntry,
+ added_at_index: usize,
+ ) {
+ if let Some(entry) = self.plugins.insert(key, plugin) {
if entry.enabled {
warn!(
"You are replacing plugin '{}' that was not disabled.",
diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs
--- a/crates/bevy_app/src/plugin_group.rs
+++ b/crates/bevy_app/src/plugin_group.rs
@@ -83,7 +95,7 @@ impl PluginGroupBuilder {
.order
.iter()
.enumerate()
- .find(|(i, ty)| *i != added_at_index && **ty == TypeId::of::<T>())
+ .find(|(i, ty)| *i != added_at_index && **ty == key)
.map(|(i, _)| i)
{
self.order.remove(to_remove);
diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs
--- a/crates/bevy_app/src/plugin_group.rs
+++ b/crates/bevy_app/src/plugin_group.rs
@@ -118,6 +130,26 @@ impl PluginGroupBuilder {
self
}
+ /// Adds a [`PluginGroup`] at the end of this [`PluginGroupBuilder`]. If the plugin was
+ /// already in the group, it is removed from its previous place.
+ pub fn add_group(mut self, group: impl PluginGroup) -> Self {
+ let Self {
+ mut plugins, order, ..
+ } = group.build();
+
+ for plugin_id in order {
+ self.upsert_plugin_entry_state(
+ plugin_id,
+ plugins.remove(&plugin_id).unwrap(),
+ self.order.len(),
+ );
+
+ self.order.push(plugin_id);
+ }
+
+ self
+ }
+
/// Adds a [`Plugin`] in this [`PluginGroupBuilder`] before the plugin of type `Target`.
/// If the plugin was already the group, it is removed from its previous place. There must
/// be a plugin of type `Target` in the group or it will panic.
|
diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs
--- a/crates/bevy_app/src/plugin_group.rs
+++ b/crates/bevy_app/src/plugin_group.rs
@@ -335,4 +367,48 @@ mod tests {
]
);
}
+
+ #[test]
+ fn add_basic_subgroup() {
+ let group_a = PluginGroupBuilder::start::<NoopPluginGroup>()
+ .add(PluginA)
+ .add(PluginB);
+
+ let group_b = PluginGroupBuilder::start::<NoopPluginGroup>()
+ .add_group(group_a)
+ .add(PluginC);
+
+ assert_eq!(
+ group_b.order,
+ vec![
+ std::any::TypeId::of::<PluginA>(),
+ std::any::TypeId::of::<PluginB>(),
+ std::any::TypeId::of::<PluginC>(),
+ ]
+ );
+ }
+
+ #[test]
+ fn add_conflicting_subgroup() {
+ let group_a = PluginGroupBuilder::start::<NoopPluginGroup>()
+ .add(PluginA)
+ .add(PluginC);
+
+ let group_b = PluginGroupBuilder::start::<NoopPluginGroup>()
+ .add(PluginB)
+ .add(PluginC);
+
+ let group = PluginGroupBuilder::start::<NoopPluginGroup>()
+ .add_group(group_a)
+ .add_group(group_b);
+
+ assert_eq!(
+ group.order,
+ vec![
+ std::any::TypeId::of::<PluginA>(),
+ std::any::TypeId::of::<PluginB>(),
+ std::any::TypeId::of::<PluginC>(),
+ ]
+ );
+ }
}
|
Enable subgroups for PluginGroups
The primary place I see this being used is for DefaultPlugins.
Would allow bevies' default plugins to to take advantage of PluginGroups with only a PluginGroup instead of a Plugin + PluginGroup.
Example API:
```rust
// Implements Plugin
pub struct FooPlugin;
// Implements Plugin
pub struct BarPlugin;
// Implements PluginGroup
pub struct CowPlugins;
// Example plugin group
pub struct ExamplePlugins;
impl PluginGroup for ExamplePlugins {
fn build(&mut self, group: &mut PluginGroupBuilder) {
group
.add(FooPlugin)
.add_group(CowPlugins)
.add(BarPlugin);
}
}
```
|
2023-08-22T02:51:39Z
|
1.76
|
2024-05-27T09:08:24Z
|
c9ec95d7827297528d0779e3fd232dfc2e3cbed7
|
[
"plugin_group::tests::add_after",
"plugin_group::tests::add_before",
"plugin_group::tests::basic_ordering",
"plugin_group::tests::readd",
"plugin_group::tests::readd_after",
"app::tests::test_derive_app_label",
"plugin_group::tests::readd_before",
"app::tests::cant_call_app_run_from_plugin_build - should panic",
"app::tests::cant_add_twice_the_same_plugin - should panic",
"crates/bevy_app/src/plugin.rs - plugin::Plugin (line 42)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 8,691
|
bevyengine__bevy-8691
|
[
"8596"
] |
735f9b60241000f49089ae587ba7d88bf2a5d932
|
diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs
--- a/crates/bevy_reflect/src/impls/std.rs
+++ b/crates/bevy_reflect/src/impls/std.rs
@@ -374,6 +374,12 @@ macro_rules! impl_reflect_for_hashmap {
.map(|(key, value)| (key as &dyn Reflect, value as &dyn Reflect))
}
+ fn get_at_mut(&mut self, index: usize) -> Option<(&dyn Reflect, &mut dyn Reflect)> {
+ self.iter_mut()
+ .nth(index)
+ .map(|(key, value)| (key as &dyn Reflect, value as &mut dyn Reflect))
+ }
+
fn len(&self) -> usize {
Self::len(self)
}
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -52,6 +52,9 @@ pub trait Map: Reflect {
/// Returns the key-value pair at `index` by reference, or `None` if out of bounds.
fn get_at(&self, index: usize) -> Option<(&dyn Reflect, &dyn Reflect)>;
+ /// Returns the key-value pair at `index` by reference where the value is a mutable reference, or `None` if out of bounds.
+ fn get_at_mut(&mut self, index: usize) -> Option<(&dyn Reflect, &mut dyn Reflect)>;
+
/// Returns the number of elements in the map.
fn len(&self) -> usize;
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -257,6 +260,12 @@ impl Map for DynamicMap {
.map(|(key, value)| (&**key, &**value))
}
+ fn get_at_mut(&mut self, index: usize) -> Option<(&dyn Reflect, &mut dyn Reflect)> {
+ self.values
+ .get_mut(index)
+ .map(|(key, value)| (&**key, &mut **value))
+ }
+
fn insert_boxed(
&mut self,
key: Box<dyn Reflect>,
|
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -491,6 +500,8 @@ pub fn map_apply<M: Map>(a: &mut M, b: &dyn Reflect) {
#[cfg(test)]
mod tests {
use super::DynamicMap;
+ use super::Map;
+ use crate::reflect::Reflect;
#[test]
fn test_into_iter() {
diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs
--- a/crates/bevy_reflect/src/map.rs
+++ b/crates/bevy_reflect/src/map.rs
@@ -511,4 +522,58 @@ mod tests {
assert_eq!(expected[index], value);
}
}
+
+ #[test]
+ fn test_map_get_at() {
+ let values = ["first", "second", "third"];
+ let mut map = DynamicMap::default();
+ map.insert(0usize, values[0].to_string());
+ map.insert(1usize, values[1].to_string());
+ map.insert(1usize, values[2].to_string());
+
+ let (key_r, value_r) = map.get_at(1).expect("Item wasn't found");
+ let value = value_r
+ .downcast_ref::<String>()
+ .expect("Couldn't downcast to String");
+ let key = key_r
+ .downcast_ref::<usize>()
+ .expect("Couldn't downcast to usize");
+ assert_eq!(key, &1usize);
+ assert_eq!(value, &values[2].to_owned());
+
+ assert!(map.get_at(2).is_none());
+ map.remove(&1usize as &dyn Reflect);
+ assert!(map.get_at(1).is_none());
+ }
+
+ #[test]
+ fn test_map_get_at_mut() {
+ let values = ["first", "second", "third"];
+ let mut map = DynamicMap::default();
+ map.insert(0usize, values[0].to_string());
+ map.insert(1usize, values[1].to_string());
+ map.insert(1usize, values[2].to_string());
+
+ let (key_r, value_r) = map.get_at_mut(1).expect("Item wasn't found");
+ let value = value_r
+ .downcast_mut::<String>()
+ .expect("Couldn't downcast to String");
+ let key = key_r
+ .downcast_ref::<usize>()
+ .expect("Couldn't downcast to usize");
+ assert_eq!(key, &1usize);
+ assert_eq!(value, &mut values[2].to_owned());
+
+ *value = values[0].to_owned();
+
+ assert_eq!(
+ map.get(&1usize as &dyn Reflect)
+ .expect("Item wasn't found")
+ .downcast_ref::<String>()
+ .expect("Couldn't downcast to String"),
+ &values[0].to_owned()
+ );
+
+ assert!(map.get_at(2).is_none());
+ }
}
|
Add `get_at_mut` to `Map` trait
## What problem does this solve or what need does it fill?
Currently the solution to getting a mutable reference to the key/value at an index of a map is to get the key and value immutably, clone the key, then use that to index the map. This is unnecessarily inefficient and could easily be avoided.
## What solution would you like?
A `get_at_mut` method that works like `get_at`, but returns mutable references.
I might PR this myself later if I remember.
|
I assume this is for ordered maps? In which case, I think it makes sense to add these kinds of methods, but with a disclaimer that not all maps guarantee a particular order.
Technically this is for any map actually; which makes me realize we need `.iter_mut()` as well to do what I'm doing properly, as I'm just relying on unordered maps being stable.
Oops I completely missed the fact that we already have `Map::get_at` (even though you mention it directly in the description).
Hello! I want to tackle this problem. I'm new here, so any help would be really appreciated @MrGVSV.
Here's what I've been able to gather so far:
- There seems to be only two implementers of this trait in bevy: `utils::hashbrown::HashMap` (actually implemented through a macro) and `reflect::DynamicMap`
- While it is possible to implement (&mut key, &mut value) for DynamicMap, however HashMap seems to provide only (& key, &mut value) iterator to use for an implementation analogous to `get_at`
So my question is:
Does `Map::get_mut_at` really need to provide mutable reference to a key? (I wonder if changing a key through such a reference could incur invalidation of HashMap state)
> Hello! I want to tackle this problem. I'm new here, so any help would be really appreciated @MrGVSV.
Awesome! Yeah feel free to leave questions in [#reflection-dev](https://discord.com/channels/691052431525675048/1002362493634629796) on Discord if you have any. Always great to have new contributors!
> Does Map::get_mut_at really need to provide mutable reference to a key? (I wonder if changing a key through such a reference could incur invalidation of HashMap state)
Good question! I don't think we should make the key mutable. I agree that that makes things a lot more complicated. On top of that, `HashMap::iter_mut` like you mention only provides `(&K, &mut V)`. So we can use that as an indicator that the key should probably be immutable.
|
2023-05-27T05:00:49Z
|
1.67
|
2023-07-10T00:11:01Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"enums::tests::enum_should_allow_struct_fields",
"enums::tests::enum_should_allow_nesting_enums",
"impls::std::tests::can_serialize_duration",
"enums::tests::should_get_enum_type_info",
"impls::std::tests::instant_should_from_reflect",
"impls::std::tests::nonzero_usize_impl_reflect_from_reflect",
"enums::tests::enum_should_return_correct_variant_path",
"enums::tests::partial_dynamic_enum_should_set_variant_fields",
"enums::tests::enum_should_return_correct_variant_type",
"enums::tests::enum_should_set",
"enums::tests::dynamic_enum_should_set_variant_fields",
"enums::tests::enum_should_partial_eq",
"impls::std::tests::option_should_apply",
"enums::tests::enum_should_allow_generics",
"enums::tests::enum_should_apply",
"enums::tests::dynamic_enum_should_change_variant",
"enums::tests::should_skip_ignored_fields",
"enums::tests::enum_should_iterate_fields",
"enums::tests::dynamic_enum_should_apply_dynamic_enum",
"enums::tests::applying_non_enum_should_panic - should panic",
"impls::std::tests::option_should_from_reflect",
"impls::std::tests::option_should_impl_enum",
"impls::std::tests::should_partial_eq_i32",
"impls::std::tests::should_partial_eq_hash_map",
"impls::std::tests::should_partial_eq_string",
"map::tests::test_into_iter",
"impls::std::tests::should_partial_eq_f32",
"path::tests::reflect_array_behaves_like_list",
"path::tests::reflect_array_behaves_like_list_mut",
"impls::std::tests::should_partial_eq_option",
"path::tests::parsed_path_parse",
"impls::std::tests::should_partial_eq_char",
"path::tests::reflect_path",
"impls::std::tests::should_partial_eq_vec",
"serde::de::tests::should_deserialize_non_self_describing_binary",
"list::tests::test_into_iter",
"tests::glam::vec3_apply_dynamic",
"tests::custom_debug_function",
"tests::as_reflect",
"tests::from_reflect_should_use_default_field_attributes",
"tests::glam::vec3_serialization",
"tests::glam::vec3_path_access",
"serde::ser::tests::should_serialize_non_self_describing_binary",
"serde::tests::unproxied_dynamic_should_not_serialize - should panic",
"impls::std::tests::path_should_from_reflect",
"serde::de::tests::enum_should_deserialize",
"serde::de::tests::should_deserialize_value",
"tests::from_reflect_should_use_default_container_attribute",
"path::tests::parsed_path_get_field",
"tests::glam::vec3_deserialization",
"tests::into_reflect",
"tests::multiple_reflect_lists",
"tests::docstrings::fields_should_contain_docs",
"tests::docstrings::should_not_contain_docs",
"tests::glam::vec3_field_access",
"tests::docstrings::should_contain_docs",
"serde::de::tests::should_deserialize_self_describing_binary",
"tests::dynamic_names",
"impls::std::tests::option_should_impl_typed",
"tests::multiple_reflect_value_lists",
"tests::docstrings::variants_should_contain_docs",
"serde::ser::tests::enum_should_serialize",
"tests::reflect_complex_patch",
"serde::ser::tests::should_serialize",
"serde::ser::tests::should_serialize_option",
"serde::tests::test_serialization_struct",
"serde::tests::test_serialization_tuple_struct",
"serde::de::tests::should_deserialize_option",
"serde::de::tests::should_deserialized_typed",
"tests::reflect_ignore",
"serde::de::tests::should_deserialize",
"serde::ser::tests::should_serialize_self_describing_binary",
"tests::should_reflect_debug",
"tests::reflect_unit_struct",
"type_uuid::test::test_generic_type_uuid_same_for_eq_param",
"type_uuid::test::test_inverted_generic_type_unique_uuid",
"type_uuid::test::test_primitive_generic_uuid",
"tests::reflect_struct",
"tests::should_permit_valid_represented_type_for_dynamic",
"type_uuid::test::test_multiple_generic_uuid",
"tests::reflect_map",
"type_registry::test::test_reflect_from_ptr",
"type_registry::test::test_property_type_registration",
"tests::should_call_from_reflect_dynamically",
"tests::reflect_take",
"tests::reflect_downcast",
"tests::should_drain_fields",
"tests::should_prohibit_invalid_represented_type_for_dynamic - should panic",
"tests::reflect_map_no_hash - should panic",
"tests::reflect_type_info",
"type_uuid::test::test_generic_type_unique_uuid",
"tests::reflect_serialize",
"type_uuid::test::test_generic_type_uuid_derive",
"src/enums/variants.rs - enums::variants::VariantInfo::Struct (line 41)",
"src/enums/variants.rs - enums::variants::VariantType::Unit (line 28)",
"src/enums/variants.rs - enums::variants::VariantInfo::Unit (line 59)",
"src/utility.rs - utility::NonGenericTypeInfoCell (line 20)",
"src/enums/variants.rs - enums::variants::VariantType::Struct (line 10)",
"src/lib.rs - (line 31)",
"src/utility.rs - utility::GenericTypeInfoCell (line 85)",
"src/enums/variants.rs - enums::variants::VariantType::Tuple (line 20)",
"src/lib.rs - (line 260)",
"src/enums/variants.rs - enums::variants::VariantInfo::Tuple (line 51)",
"src/type_info.rs - type_info::Typed (line 25)",
"src/lib.rs - (line 278)",
"src/tuple.rs - tuple::tuple_debug (line 445)",
"src/tuple.rs - tuple::Tuple (line 20)",
"src/lib.rs - (line 148)",
"src/path.rs - path::GetPath (line 101)",
"src/array.rs - array::Array (line 26)",
"src/lib.rs - (line 239)",
"src/enums/dynamic_enum.rs - enums::dynamic_enum::DynamicEnum (line 51)",
"src/tuple_struct.rs - tuple_struct::tuple_struct_debug (line 430)",
"src/tuple_struct.rs - tuple_struct::GetTupleStructField (line 172)",
"src/path.rs - path::GetPath (line 78)",
"src/lib.rs - (line 77)",
"src/lib.rs - (line 183)",
"src/tuple_struct.rs - tuple_struct::TupleStruct (line 16)",
"src/type_registry.rs - type_registry::TypeRegistration (line 292)",
"src/enums/helpers.rs - enums::helpers::enum_debug (line 82)",
"src/lib.rs - (line 134)",
"src/struct_trait.rs - struct_trait::Struct (line 21)",
"src/list.rs - list::List (line 32)",
"src/type_registry.rs - type_registry::ReflectFromPtr (line 507)",
"src/lib.rs - (line 169)",
"src/list.rs - list::list_debug (line 471)",
"src/from_reflect.rs - from_reflect::ReflectFromReflect (line 77)",
"src/struct_trait.rs - struct_trait::GetField (line 222)",
"src/array.rs - array::array_debug (line 429)",
"src/path.rs - path::GetPath (line 167)",
"src/from_reflect.rs - from_reflect::ReflectFromReflect (line 57)",
"src/struct_trait.rs - struct_trait::struct_debug (line 531)",
"src/path.rs - path::GetPath (line 115)",
"src/lib.rs - (line 98)",
"src/type_registry.rs - type_registry::TypeRegistry::register_type_data (line 138)",
"src/tuple.rs - tuple::GetTupleField (line 91)",
"src/lib.rs - (line 207)",
"src/map.rs - map::Map (line 25)",
"src/path.rs - path::ParsedPath::parse (line 312)",
"src/path.rs - path::GetPath (line 137)",
"src/lib.rs - (line 321)"
] |
[] |
[] |
[] |
auto_2025-06-08
|
bevyengine/bevy
| 8,476
|
bevyengine__bevy-8476
|
[
"8474"
] |
abf12f3b3be0a537484aa3ce0adc625f627c413a
|
diff --git a/crates/bevy_hierarchy/src/hierarchy.rs b/crates/bevy_hierarchy/src/hierarchy.rs
--- a/crates/bevy_hierarchy/src/hierarchy.rs
+++ b/crates/bevy_hierarchy/src/hierarchy.rs
@@ -46,9 +46,9 @@ fn despawn_with_children_recursive_inner(world: &mut World, entity: Entity) {
}
}
-fn despawn_children(world: &mut World, entity: Entity) {
- if let Some(mut children) = world.get_mut::<Children>(entity) {
- for e in std::mem::take(&mut children.0) {
+fn despawn_children_recursive(world: &mut World, entity: Entity) {
+ if let Some(children) = world.entity_mut(entity).take::<Children>() {
+ for e in children.0 {
despawn_with_children_recursive_inner(world, e);
}
}
diff --git a/crates/bevy_hierarchy/src/hierarchy.rs b/crates/bevy_hierarchy/src/hierarchy.rs
--- a/crates/bevy_hierarchy/src/hierarchy.rs
+++ b/crates/bevy_hierarchy/src/hierarchy.rs
@@ -76,7 +76,7 @@ impl Command for DespawnChildrenRecursive {
entity = bevy_utils::tracing::field::debug(self.entity)
)
.entered();
- despawn_children(world, self.entity);
+ despawn_children_recursive(world, self.entity);
}
}
diff --git a/crates/bevy_hierarchy/src/hierarchy.rs b/crates/bevy_hierarchy/src/hierarchy.rs
--- a/crates/bevy_hierarchy/src/hierarchy.rs
+++ b/crates/bevy_hierarchy/src/hierarchy.rs
@@ -127,11 +127,9 @@ impl<'w> DespawnRecursiveExt for EntityMut<'w> {
)
.entered();
- // SAFETY: The location is updated.
- unsafe {
- despawn_children(self.world_mut(), entity);
- self.update_location();
- }
+ self.world_scope(|world| {
+ despawn_children_recursive(world, entity);
+ });
}
}
|
diff --git a/crates/bevy_hierarchy/src/hierarchy.rs b/crates/bevy_hierarchy/src/hierarchy.rs
--- a/crates/bevy_hierarchy/src/hierarchy.rs
+++ b/crates/bevy_hierarchy/src/hierarchy.rs
@@ -226,4 +224,26 @@ mod tests {
]
);
}
+
+ #[test]
+ fn despawn_descendants() {
+ let mut world = World::default();
+ let mut queue = CommandQueue::default();
+ let mut commands = Commands::new(&mut queue, &world);
+
+ let parent = commands.spawn_empty().id();
+ let child = commands.spawn_empty().id();
+
+ commands
+ .entity(parent)
+ .add_child(child)
+ .despawn_descendants();
+
+ queue.apply(&mut world);
+
+ // The parent's Children component should be removed.
+ assert!(world.entity(parent).get::<Children>().is_none());
+ // The child should be despawned.
+ assert!(world.get_entity(child).is_none());
+ }
}
|
`despawn_descendants` does not clear `Children` component on parent entity
## Bevy version
0.10
## What you did
Call `.despawn_descendants` either via `Commands` or directly on the `World` via `.entity_mut()`.
## What went wrong
The parent's `Children` component is not cleared.
## Additional information
These methods are defined [here](https://github.com/bevyengine/bevy/blob/abf12f3b3be0a537484aa3ce0adc625f627c413a/crates/bevy_hierarchy/src/hierarchy.rs#L120)
|
2023-04-23T19:29:09Z
|
1.67
|
2025-01-28T04:46:47Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"hierarchy::tests::despawn_descendants"
] |
[
"child_builder::tests::build_children",
"child_builder::tests::children_removed_when_empty_commands",
"child_builder::tests::add_child",
"child_builder::tests::children_removed_when_empty_world",
"child_builder::tests::push_and_insert_and_remove_children_world",
"child_builder::tests::regression_push_children_same_archetype",
"child_builder::tests::push_and_clear_children_commands",
"child_builder::tests::push_and_insert_and_remove_children_commands",
"child_builder::tests::push_children_idempotent",
"child_builder::tests::remove_parent",
"child_builder::tests::set_parent_of_orphan",
"child_builder::tests::push_and_replace_children_commands",
"child_builder::tests::set_parent",
"hierarchy::tests::despawn_recursive",
"query_extension::tests::ancestor_iter",
"query_extension::tests::descendant_iter",
"crates/bevy_hierarchy/src/query_extension.rs - query_extension::HierarchyQueryExt::iter_ancestors (line 42)",
"crates/bevy_hierarchy/src/query_extension.rs - query_extension::HierarchyQueryExt::iter_descendants (line 20)"
] |
[] |
[] |
auto_2025-06-08
|
|
bevyengine/bevy
| 8,467
|
bevyengine__bevy-8467
|
[
"8463"
] |
15a96adc01d9b9df4237290efd7f0020b50482ae
|
diff --git a/crates/bevy_time/src/timer.rs b/crates/bevy_time/src/timer.rs
--- a/crates/bevy_time/src/timer.rs
+++ b/crates/bevy_time/src/timer.rs
@@ -224,10 +224,17 @@ impl Timer {
if self.finished() {
if self.mode == TimerMode::Repeating {
- self.times_finished_this_tick =
- (self.elapsed().as_nanos() / self.duration().as_nanos()) as u32;
- // Duration does not have a modulo
- self.set_elapsed(self.elapsed() - self.duration() * self.times_finished_this_tick);
+ self.times_finished_this_tick = self
+ .elapsed()
+ .as_nanos()
+ .checked_div(self.duration().as_nanos())
+ .map_or(u32::MAX, |x| x as u32);
+ self.set_elapsed(
+ self.elapsed()
+ .as_nanos()
+ .checked_rem(self.duration().as_nanos())
+ .map_or(Duration::ZERO, |x| Duration::from_nanos(x as u64)),
+ );
} else {
self.times_finished_this_tick = 1;
self.set_elapsed(self.duration());
diff --git a/crates/bevy_time/src/timer.rs b/crates/bevy_time/src/timer.rs
--- a/crates/bevy_time/src/timer.rs
+++ b/crates/bevy_time/src/timer.rs
@@ -329,7 +336,11 @@ impl Timer {
/// ```
#[inline]
pub fn percent(&self) -> f32 {
- self.elapsed().as_secs_f32() / self.duration().as_secs_f32()
+ if self.duration == Duration::ZERO {
+ 1.0
+ } else {
+ self.elapsed().as_secs_f32() / self.duration().as_secs_f32()
+ }
}
/// Returns the percentage of the timer remaining time (goes from 1.0 to 0.0).
|
diff --git a/crates/bevy_time/src/timer.rs b/crates/bevy_time/src/timer.rs
--- a/crates/bevy_time/src/timer.rs
+++ b/crates/bevy_time/src/timer.rs
@@ -517,6 +528,26 @@ mod tests {
assert_eq!(t.times_finished_this_tick(), 0);
}
+ #[test]
+ fn times_finished_this_tick_repeating_zero_duration() {
+ let mut t = Timer::from_seconds(0.0, TimerMode::Repeating);
+ assert_eq!(t.times_finished_this_tick(), 0);
+ assert_eq!(t.elapsed(), Duration::ZERO);
+ assert_eq!(t.percent(), 1.0);
+ t.tick(Duration::from_secs(1));
+ assert_eq!(t.times_finished_this_tick(), u32::MAX);
+ assert_eq!(t.elapsed(), Duration::ZERO);
+ assert_eq!(t.percent(), 1.0);
+ t.tick(Duration::from_secs(2));
+ assert_eq!(t.times_finished_this_tick(), u32::MAX);
+ assert_eq!(t.elapsed(), Duration::ZERO);
+ assert_eq!(t.percent(), 1.0);
+ t.reset();
+ assert_eq!(t.times_finished_this_tick(), 0);
+ assert_eq!(t.elapsed(), Duration::ZERO);
+ assert_eq!(t.percent(), 1.0);
+ }
+
#[test]
fn times_finished_this_tick_precise() {
let mut t = Timer::from_seconds(0.01, TimerMode::Repeating);
|
Setting the timer duration to zero panicks
## Bevy version
bevy 0.10.1
## What you did
I set a repeating timers duration to 0. I did so accidentally using the egui_inspector, but is also reproducible if setting it via code.
## What went wrong
Bevy panicked, because it can't divide by 0.
thread 'Compute Task Pool (3)' panicked at 'attempt to divide by zero', C:\<redacted>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_time-0.10.1\src\timer.rs:228:21
Caused by this line of code:
```
self.times_finished_this_tick =
(self.elapsed().as_nanos() / self.duration().as_nanos()) as u32;```
## Additional information
While in my case it happened for a repeating timer, similar panics can and will happen if for example the percent function of the timer is used, while the duration is set to 0.
|
Also I'm not entirely sure what the expected behaviour would be in a case like that (except it not panicking :) ).
I'm not 100% sure what the correct behavior is here either, but it shouldn't be too hard to investigate.
|
2023-04-22T22:00:36Z
|
1.67
|
2023-04-24T15:17:08Z
|
735f9b60241000f49089ae587ba7d88bf2a5d932
|
[
"timer::tests::times_finished_this_tick_repeating_zero_duration"
] |
[
"time::tests::wrapping_test",
"time::tests::pause_test",
"time::tests::update_test",
"common_conditions::tests::distributive_run_if_compiles",
"timer::tests::times_finished_this_tick",
"timer::tests::paused_repeating",
"fixed_timestep::test::fixed_time_starts_at_zero",
"timer::tests::times_finished_this_tick_precise",
"fixed_timestep::test::repeatedly_expending_time",
"fixed_timestep::test::fixed_time_ticks_up",
"timer::tests::repeating_timer",
"timer::tests::times_finished_repeating",
"fixed_timestep::test::enough_accumulated_time_is_required",
"timer::tests::paused",
"time::tests::relative_speed_test",
"timer::tests::non_repeating_timer",
"src/common_conditions.rs - common_conditions::on_fixed_timer (line 48) - compile",
"src/common_conditions.rs - common_conditions::on_timer (line 10) - compile",
"src/stopwatch.rs - stopwatch::Stopwatch::set_elapsed (line 105)",
"src/timer.rs - timer::Timer::from_seconds (line 38)",
"src/timer.rs - timer::Timer::duration (line 132)",
"src/stopwatch.rs - stopwatch::Stopwatch::reset (line 193)",
"src/timer.rs - timer::Timer::mode (line 161)",
"src/stopwatch.rs - stopwatch::Stopwatch::elapsed (line 52)",
"src/stopwatch.rs - stopwatch::Stopwatch::new (line 38)",
"src/stopwatch.rs - stopwatch::Stopwatch::paused (line 176)",
"src/stopwatch.rs - stopwatch::Stopwatch::unpause (line 157)",
"src/time.rs - time::Time::update_with_instant (line 96)",
"src/timer.rs - timer::Timer::elapsed (line 91)",
"src/timer.rs - timer::Timer::finished (line 54)",
"src/timer.rs - timer::Timer::just_finished (line 71)",
"src/timer.rs - timer::Timer::set_mode (line 174)",
"src/timer.rs - timer::Timer::tick (line 198)",
"src/stopwatch.rs - stopwatch::Stopwatch::tick (line 122)",
"src/stopwatch.rs - stopwatch::Stopwatch (line 9)",
"src/stopwatch.rs - stopwatch::Stopwatch::elapsed_secs (line 73)",
"src/timer.rs - timer::Timer::set_elapsed (line 115)",
"src/stopwatch.rs - stopwatch::Stopwatch::pause (line 140)",
"src/timer.rs - timer::Timer::set_duration (line 146)"
] |
[] |
[] |
auto_2025-06-08
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.