Swap ptr::read
for ptr::drop_in_place
This commit is contained in:
parent
2a4c018518
commit
a67749ae87
1 changed files with 1 additions and 1 deletions
|
@ -814,7 +814,7 @@ impl<T> Vec<T> {
|
|||
if !f(&v[i]) {
|
||||
del += 1;
|
||||
unsafe {
|
||||
ptr::read(&v[i]);
|
||||
ptr::drop_in_place(&mut v[i]);
|
||||
}
|
||||
} else if del > 0 {
|
||||
let src: *const T = &v[i];
|
||||
|
|
Loading…
Reference in a new issue