Skip to content

Commit

Permalink
allow deriving bundle for struct with generics with where clause (#1811)
Browse files Browse the repository at this point in the history
fixes #1777 

Seems the `_where_clause` parameter to lost somewhere, adding it back
  • Loading branch information
mockersf committed Apr 3, 2021
1 parent 9098df3 commit 3e285d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ pub fn derive_bundle(input: TokenStream) -> TokenStream {
}
let field_len = field.len();
let generics = ast.generics;
let (impl_generics, ty_generics, _where_clause) = generics.split_for_impl();
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
let struct_name = &ast.ident;

TokenStream::from(quote! {
/// SAFE: TypeInfo is returned in field-definition-order. [from_components] and [get_components] use field-definition-order
unsafe impl #impl_generics #ecs_path::bundle::Bundle for #struct_name#ty_generics {
unsafe impl #impl_generics #ecs_path::bundle::Bundle for #struct_name#ty_generics #where_clause {
fn type_info() -> Vec<#ecs_path::component::TypeInfo> {
let mut type_info = Vec::with_capacity(#field_len);
#(#field_type_infos)*
Expand Down

0 comments on commit 3e285d5

Please sign in to comment.