about summary refs log tree commit diff
path: root/src/libstd/vec.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-17 05:11:41 -0800
committerbors <bors@rust-lang.org>2013-12-17 05:11:41 -0800
commitfb6ec38352b56250045f7450af4eb2af1a019dcd (patch)
tree1f157ebe8c90d727988db5d1068a4415392198d9 /src/libstd/vec.rs
parent793eb1d38d6549e26fbf3014604c5c81e4b18c4f (diff)
parent664c9af1e968ed5734425574e9d122014679a739 (diff)
downloadrust-fb6ec38352b56250045f7450af4eb2af1a019dcd.tar.gz
rust-fb6ec38352b56250045f7450af4eb2af1a019dcd.zip
auto merge of #10998 : thestinger/rust/iter, r=alexcrichton
Diffstat (limited to 'src/libstd/vec.rs')
-rw-r--r--src/libstd/vec.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 25a6429d851..65be214c14e 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -2673,11 +2673,9 @@ impl<T> DoubleEndedIterator<T> for MoveIterator<T> {
 #[unsafe_destructor]
 impl<T> Drop for MoveIterator<T> {
     fn drop(&mut self) {
+        // destroy the remaining elements
+        for _x in *self {}
         unsafe {
-            // destroy the remaining elements
-            for x in self.iter {
-                ptr::read_ptr(x);
-            }
             if owns_managed::<T>() {
                 local_free(self.allocation as *u8 as *c_char)
             } else {