Skip to content

Commit

Permalink
Fix ownership issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Sep 5, 2017
1 parent 0e2427c commit 4817754
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,9 @@ impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
return Some(ptr::read(&v[i]));
} else if self.del > 0 {
let del = self.del;
ptr::copy_nonoverlapping(self.vec.as_ptr().offset(i), self.vec.as_mut_ptr().offset(i - del), 1);
let src = self.vec.as_ptr().offset(i);
let dst = self.vec.as_mut_ptr().offset(i - del);
ptr::copy_nonoverlapping(src, dst, 1);
}
}
None
Expand Down

0 comments on commit 4817754

Please sign in to comment.