diff --git a/crates/oxc_ast/src/ast_builder.rs b/crates/oxc_ast/src/ast_builder.rs index 8c8edb2ecc9f9..b5466b10db666 100644 --- a/crates/oxc_ast/src/ast_builder.rs +++ b/crates/oxc_ast/src/ast_builder.rs @@ -68,11 +68,13 @@ impl<'a> AstBuilder<'a> { Atom::from(String::from_str_in(value, self.allocator).into_bump_str()) } + /// # 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! + /// #[inline] pub fn copy(self, src: &T) -> T { - // SAFETY: - // This should be safe as long as `src` is an reference from the allocator. - // But honestly, I'm not really sure if this is safe. + // SAFETY: Not safe (see above) #[allow(unsafe_code)] unsafe { std::mem::transmute_copy(src)