diff options
| author | bors <bors@rust-lang.org> | 2020-06-03 01:00:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-03 01:00:39 +0000 |
| commit | 680a4b2fbdca0dc6c5ceec826a8dbeabe28f305d (patch) | |
| tree | 200cca83afffab0ecf5dc1427de7b8169069ad7f /src/liballoc | |
| parent | fe10f1a49f5ca46e57261b95f46f519523f418fe (diff) | |
| parent | ba3d98250f886279e204f6e650666df6818777e2 (diff) | |
| download | rust-680a4b2fbdca0dc6c5ceec826a8dbeabe28f305d.tar.gz rust-680a4b2fbdca0dc6c5ceec826a8dbeabe28f305d.zip | |
Auto merge of #72935 - Dylan-DPC:rollup-60g3ab6, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #72704 (Remote testing fixes) - #72820 (InstCombine: Don't optimize `&mut *x` into `x`) - #72848 (Correct generic parameter ordering in error note for E0747) - #72902 (Add a test to ensure Fuse stays covariant) - #72921 (Add assert to Vec with_capacity docs) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 42fb1f8c737..22d43468771 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -348,9 +348,11 @@ impl<T> Vec<T> { /// for i in 0..10 { /// vec.push(i); /// } + /// assert_eq!(vec.capacity(), 10); /// /// // ...but this may make the vector reallocate /// vec.push(11); + /// assert!(vec.capacity() >= 11); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] |
