Skip to content

Commit 72247e6

Browse files
committed
fix(allocator): remove Clone impl from Vec
1 parent 2535244 commit 72247e6

File tree

1 file changed

+0
-20
lines changed
  • crates/oxc_allocator/src/vec2

1 file changed

+0
-20
lines changed

crates/oxc_allocator/src/vec2/mod.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,26 +2067,6 @@ impl<'a, T: 'a + PartialEq, A: Alloc> Vec<'a, T, A> {
20672067
// Common trait implementations for Vec
20682068
////////////////////////////////////////////////////////////////////////////////
20692069

2070-
impl<'a, T: 'a + Clone, A: Alloc> Clone for Vec<'a, T, A> {
2071-
#[cfg(not(test))]
2072-
fn clone(&self) -> Vec<'a, T, A> {
2073-
let mut v = Vec::with_capacity_in(self.len_usize(), self.buf.bump());
2074-
v.extend(self.iter().cloned());
2075-
v
2076-
}
2077-
2078-
// HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
2079-
// required for this method definition, is not available. Instead use the
2080-
// `slice::to_vec` function which is only available with cfg(test)
2081-
// NB see the slice::hack module in slice.rs for more information
2082-
#[cfg(test)]
2083-
fn clone(&self) -> Vec<'a, T, A> {
2084-
let mut v = Vec::new_in(self.buf.bump());
2085-
v.extend(self.iter().cloned());
2086-
v
2087-
}
2088-
}
2089-
20902070
impl<'a, T: 'a + Hash, A: Alloc> Hash for Vec<'a, T, A> {
20912071
#[inline]
20922072
fn hash<H: hash::Hasher>(&self, state: &mut H) {

0 commit comments

Comments
 (0)