Swap ptr::read for ptr::drop_in_place

This commit is contained in:
Jacob Kiesel 2018-02-08 08:27:53 -07:00 committed by GitHub
parent 2a4c018518
commit a67749ae87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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];