diff --git a/crates/oxc_ast/src/generated/visit.rs b/crates/oxc_ast/src/generated/visit.rs index 9ea569d11ebf7a..de23b063413e24 100644 --- a/crates/oxc_ast/src/generated/visit.rs +++ b/crates/oxc_ast/src/generated/visit.rs @@ -31,6 +31,7 @@ pub trait Visit<'a>: Sized { fn enter_scope(&mut self, flags: ScopeFlags) {} fn leave_scope(&mut self) {} + #[inline] fn alloc(&self, t: &T) -> &'a T { // SAFETY: // This should be safe as long as `src` is an reference from the allocator. diff --git a/tasks/ast_codegen/src/generators/visit.rs b/tasks/ast_codegen/src/generators/visit.rs index 5b6e1927e0be1f..0ae0e3b70f1051 100644 --- a/tasks/ast_codegen/src/generators/visit.rs +++ b/tasks/ast_codegen/src/generators/visit.rs @@ -98,6 +98,7 @@ fn generate_visit(ctx: &CodegenCtx) -> TokenStream { endl!(); + #[inline] fn alloc(&self, t: &T) -> &'a T { insert!("// SAFETY:"); insert!("// This should be safe as long as `src` is an reference from the allocator.");