diff --git a/crates/oxc_syntax/src/reference.rs b/crates/oxc_syntax/src/reference.rs index dfd234f8db993a..de255ae75c6270 100644 --- a/crates/oxc_syntax/src/reference.rs +++ b/crates/oxc_syntax/src/reference.rs @@ -14,11 +14,15 @@ pub struct ReferenceId(NonMaxU32); impl<'alloc> CloneIn<'alloc> for ReferenceId { type Cloned = Self; - fn clone_in(&self, _: &'alloc oxc_allocator::Allocator) -> Self::Cloned { + fn clone_in(&self, _: &'alloc Allocator) -> Self { + // `clone_in` should never reach this, because `CloneIn` skips semantic ID fields + unreachable!(); + } + + fn clone_in_with_semantic_ids(&self, _: &'alloc Allocator) -> Self { *self } } - impl Idx for ReferenceId { #[allow(clippy::cast_possible_truncation)] fn from_usize(idx: usize) -> Self {