Skip to content

Commit fb6ec38

Browse files
committed
auto merge of #10998 : thestinger/rust/iter, r=alexcrichton
2 parents 793eb1d + 664c9af commit fb6ec38

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libstd/vec.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,11 +2673,9 @@ impl<T> DoubleEndedIterator<T> for MoveIterator<T> {
26732673
#[unsafe_destructor]
26742674
impl<T> Drop for MoveIterator<T> {
26752675
fn drop(&mut self) {
2676+
// destroy the remaining elements
2677+
for _x in *self {}
26762678
unsafe {
2677-
// destroy the remaining elements
2678-
for x in self.iter {
2679-
ptr::read_ptr(x);
2680-
}
26812679
if owns_managed::<T>() {
26822680
local_free(self.allocation as *u8 as *c_char)
26832681
} else {

0 commit comments

Comments
 (0)