diff options
| author | Jacob Kiesel <kieseljake@gmail.com> | 2017-09-05 15:38:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-05 15:38:45 -0600 |
| commit | 4817754677826b07af9035133f8433b94c364ff7 (patch) | |
| tree | 17babd9bf58ee8578dd8d09c44a39ea505e5ac19 /src/liballoc | |
| parent | 0e2427cd3c52f251d135b7f8c0d73f93369b6e7e (diff) | |
Fix ownership issues
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 158331af2ae..64e84063b7a 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -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 |
