Skip to content

Commit

Permalink
Clarify double-drop comment
Browse files Browse the repository at this point in the history
  • Loading branch information
aloucks committed Jul 7, 2019
1 parent a4a6a67 commit df5b32e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/liballoc/vec.rs
Expand Up @@ -2825,7 +2825,7 @@ impl<T, F> Drop for DrainFilter<'_, T, F>
// to execute `pred`, so we just backshift all the unprocessed
// elements and tell the vec that they still exist. The backshift
// is required to prevent a double-drop of the last successfully
// drained item following a panic in the predicate.
// drained item prior to a panic in the predicate.
let ptr = self.drain.vec.as_mut_ptr();
let src = ptr.add(self.drain.idx);
let dst = src.sub(self.drain.del);
Expand Down

0 comments on commit df5b32e

Please sign in to comment.