Wrap in Boxes.
This commit is contained in:
parent
0a97cc01b9
commit
4d70765d17
@ -20,7 +20,7 @@ fn make_child_holder(child_spec: &ChildSpec) -> Option<TokenStream> {
|
||||
),
|
||||
};
|
||||
Some(quote! {
|
||||
let mut #child_ident: Vec<#child_type_ident> = vec![]
|
||||
let mut #child_ident: Vec<Box<#child_type_ident>> = vec![]
|
||||
})
|
||||
}
|
||||
ChildSpec::SingleChild(single_child) => match single_child.build() {
|
||||
@ -28,7 +28,7 @@ fn make_child_holder(child_spec: &ChildSpec) -> Option<TokenStream> {
|
||||
let child_ident = format_ident!("{}", single_type_child.var_name());
|
||||
let child_type_ident = format_ident!("{}", single_type_child.build());
|
||||
Some(quote! {
|
||||
let mut #child_ident: Option<#child_type_ident> = None;
|
||||
let mut #child_ident: Option<Box<#child_type_ident>> = None;
|
||||
})
|
||||
}
|
||||
SingleChildToBuild::Boolean(boolean_child) => {
|
||||
@ -52,7 +52,7 @@ fn make_match_action(child_spec: &ChildSpec) -> TokenStream {
|
||||
),
|
||||
};
|
||||
quote! {
|
||||
#child_name_ident.push(#build_fn_ident(inner_pair))
|
||||
#child_name_ident.push(Box::new(#build_fn_ident(inner_pair)))
|
||||
}
|
||||
}
|
||||
ChildSpec::SingleChild(single_child) => match single_child.build() {
|
||||
@ -60,7 +60,7 @@ fn make_match_action(child_spec: &ChildSpec) -> TokenStream {
|
||||
let child_name_ident = format_ident!("{}", single_type_child.var_name());
|
||||
let build_fn_ident = format_ident!("{}", single_type_child.with());
|
||||
quote! {
|
||||
#child_name_ident = Some(#build_fn_ident(inner_pair))
|
||||
#child_name_ident = Some(Box::new(#build_fn_ident(inner_pair)))
|
||||
}
|
||||
}
|
||||
SingleChildToBuild::Boolean(single_boolean_child) => {
|
||||
|
Loading…
Reference in New Issue
Block a user