]> git.lizzy.rs Git - rust.git/commitdiff
Fix ownership issues
authorJacob Kiesel <kieseljake@gmail.com>
Tue, 5 Sep 2017 21:38:45 +0000 (15:38 -0600)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2017 21:38:45 +0000 (15:38 -0600)
src/liballoc/vec.rs

index 158331af2aeeda52b189daf3ec1572f3812432bf..64e84063b7a172d22d4b21747cba3b846042b220 100644 (file)
@@ -2692,7 +2692,9 @@ fn next(&mut self) -> Option<T> {
                     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