File tree 2 files changed +8
-2
lines changed 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ pub fn derive_component(input: TokenStream) -> TokenStream {
220
220
quote ! {
221
221
/// If not already present, the required component will be inserted using
222
222
#[ doc = #insertion_info]
223
- impl #impl_generics #bevy_ecs_path:: component:: Require <#path> for #struct_name #type_generics #where_clause { }
223
+ unsafe impl #impl_generics #bevy_ecs_path:: component:: Require <#path> for #struct_name #type_generics #where_clause { }
224
224
}
225
225
} ) ;
226
226
Original file line number Diff line number Diff line change @@ -456,7 +456,13 @@ pub trait Component: Send + Sync + 'static {
456
456
}
457
457
458
458
/// Indicates this [`Component`] requires another [`Component`] `C`.
459
- pub trait Require < C : Component > : Component { }
459
+ /// This trait is similar to [`Eq`] in the sense that it is up to the implementer to ensure `C` is
460
+ /// appropriately registered as a required component.
461
+ ///
462
+ /// # Safety
463
+ ///
464
+ /// Implementing this trait must be done in tandem with updating the implementation of [`Component::register_required_components`].
465
+ pub unsafe trait Require < C : Component > : Component { }
460
466
461
467
mod private {
462
468
pub trait Seal { }
You can’t perform that action at this time.
0 commit comments