diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index f34fe2da7e8..3e48f14d387 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -70,7 +70,12 @@ impl Clone for VecDeque { impl Drop for VecDeque { #[unsafe_destructor_blind_to_params] fn drop(&mut self) { - self.clear(); + let (front, back) = self.as_mut_slices(); + unsafe { + // use drop for [T] + ptr::drop_in_place(front); + ptr::drop_in_place(back); + } // RawVec handles deallocation } }