1
Fork 0

Rollup merge of #73063 - pickfire:liballoc-elide, r=kennytm

Elide type on liballoc vec
This commit is contained in:
Dylan DPC 2020-06-07 15:33:45 +02:00 committed by GitHub
commit a23b51ebea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -984,7 +984,7 @@ impl<T> Vec<T> {
// bounds check above succeeds there must be a last element (which
// can be self[index] itself).
let last = ptr::read(self.as_ptr().add(len - 1));
let hole: *mut T = self.as_mut_ptr().add(index);
let hole = self.as_mut_ptr().add(index);
self.set_len(len - 1);
ptr::replace(hole, last)
}