1
Fork 0

Fix issues from review and unsoundness of RawVec::into_box

This commit is contained in:
Tim Diekmann 2020-03-26 17:11:47 +01:00
parent 56cbf2f22a
commit 2526accdd3
17 changed files with 436 additions and 474 deletions

View file

@ -678,8 +678,9 @@ impl<T> Vec<T> {
unsafe {
self.shrink_to_fit();
let buf = ptr::read(&self.buf);
let len = self.len();
mem::forget(self);
buf.into_box().assume_init()
buf.into_box(len).assume_init()
}
}