We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b74208b commit 0075c27Copy full SHA for 0075c27
src/libcollections/vec.rs
@@ -1734,7 +1734,7 @@ impl<T> MutableSeq<T> for Vec<T> {
1734
let size = max(old_size, 2 * mem::size_of::<T>()) * 2;
1735
if old_size > size { fail!("capacity overflow") }
1736
unsafe {
1737
- self.ptr = alloc_or_realloc(self.ptr, self.cap * mem::size_of::<T>(), size);
+ self.ptr = alloc_or_realloc(self.ptr, old_size, size);
1738
}
1739
self.cap = max(self.cap, 2) * 2;
1740
@@ -1758,7 +1758,6 @@ impl<T> MutableSeq<T> for Vec<T> {
1758
1759
1760
1761
-
1762
1763
1764
/// An iterator that moves out of a vector.
0 commit comments