diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 690cbcb559b..ffaff20bcc9 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -840,7 +840,7 @@ impl Vec { // space for the new element if len == self.buf.cap() { - self.buf.double(); + self.reserve(1); } unsafe { @@ -1060,7 +1060,7 @@ impl Vec { // This will panic or abort if we would allocate > isize::MAX bytes // or if the length increment would overflow for zero-sized types. if self.len == self.buf.cap() { - self.buf.double(); + self.reserve(1); } unsafe { let end = self.as_mut_ptr().offset(self.len as isize);