Skip to content

Commit

Permalink
Add requested comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Sep 18, 2017
1 parent 4de0cf1 commit 10384ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/liballoc/vec.rs
Expand Up @@ -2694,6 +2694,9 @@ impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
let del = self.del;
let src: *const T = &v[i];
let dst: *mut T = &mut v[i - del];
// This is safe because self.vec has length 0
// thus its elements will not have Drop::drop
// called on them in the event of a panic.
ptr::copy_nonoverlapping(src, dst, 1);
}
}
Expand Down

0 comments on commit 10384ab

Please sign in to comment.