refactor(ast/builder): use Box::new_in over .into_in (#4428)

In `AstBuilder`'s `alloc_*` methods, use `Box::new_in` instead of `.into_in`. This is more explicit, so I feel easier to understand. It may also make life easier for compiler by not requiring it to perform type coercion.
This commit is contained in:
overlookmotel 2024-07-24 16:34:32 +00:00
parent 46cf7179a4
commit 9c5d2f9d6a
2 changed files with 377 additions and 283 deletions

File diff suppressed because it is too large Load diff

View file

@ -277,7 +277,7 @@ fn generate_struct_builder_fn(ty: &RStruct, ctx: &CodegenCtx) -> TokenStream {
endl!();
#[inline]
pub fn #alloc_fn_name #generic_params (self, #(#params),*) -> Box<'a, #as_type> #where_clause {
self.#fn_name(#(#args),*).into_in(self.allocator)
Box::new_in(self.#fn_name(#(#args),*), self.allocator)
}
}
}