mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
Fix ownership issues
This commit is contained in:
parent
0e2427cd3c
commit
4817754677
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user