From 611b0299a8d8eeb9f491d2e1d4a098b31108765d Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Tue, 18 Feb 2025 20:29:47 +0000 Subject: [PATCH] feat(ast)!: remove `AstBuilder::copy` (#9210) close: https://github.com/oxc-project/oxc/issues/3483 --- crates/oxc_ast/src/ast_builder_impl.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/crates/oxc_ast/src/ast_builder_impl.rs b/crates/oxc_ast/src/ast_builder_impl.rs index f18332ad8adb0..6173e6a46b109 100644 --- a/crates/oxc_ast/src/ast_builder_impl.rs +++ b/crates/oxc_ast/src/ast_builder_impl.rs @@ -94,17 +94,6 @@ impl<'a> AstBuilder<'a> { } } - /// # SAFETY - /// This method is completely unsound and should not be used. - /// We need to remove all uses of it. Please don't add any more! - /// - #[expect(clippy::missing_safety_doc)] - #[inline] - pub unsafe fn copy(self, src: &T) -> T { - // SAFETY: Not safe (see above) - unsafe { std::mem::transmute_copy(src) } - } - /// Moves the expression out by replacing it with an [`Expression::NullLiteral`]. #[inline] pub fn move_expression(self, expr: &mut Expression<'a>) -> Expression<'a> {