auto merge of #10998 : thestinger/rust/iter, r=alexcrichton

This commit is contained in:
bors 2013-12-17 05:11:41 -08:00
commit fb6ec38352

View File

@ -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 {