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 Vec { /// 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")]