Fix issues from review and unsoundness of RawVec::into_box
This commit is contained in:
parent
56cbf2f22a
commit
2526accdd3
17 changed files with 436 additions and 474 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue