diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2024-03-30 05:23:38 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2024-03-30 05:23:38 +0000 |
| commit | 28521fd2eb40339a20e10c124e60b5efbc31e17b (patch) | |
| tree | 90d2cf40dac38eaa763ff4df5c514b0f86b4b40e /library/alloc/src/vec | |
| parent | fee9a8eab8f1ae85135f2de7bf8bee815e364665 (diff) | |
| parent | 69fa40cb48384fad7930dce2d9a20d18fe4d1b51 (diff) | |
Merge from rustc
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 8ca8046dac5..7e3463bc082 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1547,7 +1547,7 @@ impl<T, A: Allocator> Vec<T, A> { // space for the new element if len == self.buf.capacity() { - self.reserve(1); + self.buf.grow_one(); } unsafe { @@ -1967,7 +1967,7 @@ impl<T, A: Allocator> Vec<T, A> { // 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.capacity() { - self.buf.reserve_for_push(self.len); + self.buf.grow_one(); } unsafe { let end = self.as_mut_ptr().add(self.len); |
