From db1915a1f0811958b1e978eb2e93aac3c50ea060 Mon Sep 17 00:00:00 2001 From: Volodymyr Enhelhardt <148731093+venhelhardt@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:37:50 -0800 Subject: [PATCH] Use the fully qualified name for `Component` in the `require` attribute (#16378) # Objective - Describe the objective or issue this PR addresses. Use the fully qualified name for `Component` in the `require` attribute - If you're fixing a specific issue, say "Fixes #X". Fixes #16377 ## Solution - Describe the solution used to achieve the objective above. Use the fully qualified name for `Component` in the `require` attribute, i.e.,`<#ident as #bevy_ecs_path::component::Component>` ## Testing - Did you test these changes? If so, how? `cargo run -p ci -- lints` `cargo run -p ci -- compile` `cargo run -p ci -- test` - Are there any parts that need more testing? no - How can other people (reviewers) test your changes? Is there anything specific they need to know? try to compile ```rust #[derive(::bevy::ecs::component::Component, Default)] pub struct A; #[derive(::bevy::ecs::component::Component)] #[require(A)] pub struct B; ``` - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? Mac only --- ## Migration Guide > This section is optional. If there are no breaking changes, you can delete this section. - If this PR is a breaking change (relative to the last release of Bevy), describe how a user might need to migrate their code to support these changes - Simply adding new functionality is not a breaking change. - Fixing behavior that was definitely a bug, rather than a questionable design choice is not a breaking change. Co-authored-by: Volodymyr Enhelhardt --- crates/bevy_ecs/macros/src/component.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ecs/macros/src/component.rs b/crates/bevy_ecs/macros/src/component.rs index 08b4e73056635..7797011019fb1 100644 --- a/crates/bevy_ecs/macros/src/component.rs +++ b/crates/bevy_ecs/macros/src/component.rs @@ -82,7 +82,7 @@ pub fn derive_component(input: TokenStream) -> TokenStream { for require in requires { let ident = &require.path; register_recursive_requires.push(quote! { - <#ident as Component>::register_required_components( + <#ident as #bevy_ecs_path::component::Component>::register_required_components( requiree, components, storages,