Skip to content

Commit 4817754

Browse files
authored
Fix ownership issues
1 parent 0e2427c commit 4817754

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/liballoc/vec.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,9 @@ impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
26922692
return Some(ptr::read(&v[i]));
26932693
} else if self.del > 0 {
26942694
let del = self.del;
2695-
ptr::copy_nonoverlapping(self.vec.as_ptr().offset(i), self.vec.as_mut_ptr().offset(i - del), 1);
2695+
let src = self.vec.as_ptr().offset(i);
2696+
let dst = self.vec.as_mut_ptr().offset(i - del);
2697+
ptr::copy_nonoverlapping(src, dst, 1);
26962698
}
26972699
}
26982700
None

0 commit comments

Comments
 (0)