@@ -433,6 +433,7 @@ impl<T> Vec<T> {
433
433
/// assert!(vec.capacity() >= 11);
434
434
/// ```
435
435
#[ inline]
436
+ #[ doc( alias = "malloc" ) ]
436
437
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
437
438
pub fn with_capacity ( capacity : usize ) -> Self {
438
439
Self :: with_capacity_in ( capacity, Global )
@@ -766,6 +767,7 @@ impl<T, A: Allocator> Vec<T, A> {
766
767
/// vec.reserve(10);
767
768
/// assert!(vec.capacity() >= 11);
768
769
/// ```
770
+ #[ doc( alias = "realloc" ) ]
769
771
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
770
772
pub fn reserve ( & mut self , additional : usize ) {
771
773
self . buf . reserve ( self . len , additional) ;
@@ -791,6 +793,7 @@ impl<T, A: Allocator> Vec<T, A> {
791
793
/// vec.reserve_exact(10);
792
794
/// assert!(vec.capacity() >= 11);
793
795
/// ```
796
+ #[ doc( alias = "realloc" ) ]
794
797
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
795
798
pub fn reserve_exact ( & mut self , additional : usize ) {
796
799
self . buf . reserve_exact ( self . len , additional) ;
@@ -828,6 +831,7 @@ impl<T, A: Allocator> Vec<T, A> {
828
831
/// }
829
832
/// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
830
833
/// ```
834
+ #[ doc( alias = "realloc" ) ]
831
835
#[ unstable( feature = "try_reserve" , reason = "new API" , issue = "48043" ) ]
832
836
pub fn try_reserve ( & mut self , additional : usize ) -> Result < ( ) , TryReserveError > {
833
837
self . buf . try_reserve ( self . len , additional)
@@ -869,6 +873,7 @@ impl<T, A: Allocator> Vec<T, A> {
869
873
/// }
870
874
/// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
871
875
/// ```
876
+ #[ doc( alias = "realloc" ) ]
872
877
#[ unstable( feature = "try_reserve" , reason = "new API" , issue = "48043" ) ]
873
878
pub fn try_reserve_exact ( & mut self , additional : usize ) -> Result < ( ) , TryReserveError > {
874
879
self . buf . try_reserve_exact ( self . len , additional)
@@ -888,6 +893,7 @@ impl<T, A: Allocator> Vec<T, A> {
888
893
/// vec.shrink_to_fit();
889
894
/// assert!(vec.capacity() >= 3);
890
895
/// ```
896
+ #[ doc( alias = "realloc" ) ]
891
897
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
892
898
pub fn shrink_to_fit ( & mut self ) {
893
899
// The capacity is never less than the length, and there's nothing to do when
@@ -920,6 +926,7 @@ impl<T, A: Allocator> Vec<T, A> {
920
926
/// vec.shrink_to(0);
921
927
/// assert!(vec.capacity() >= 3);
922
928
/// ```
929
+ #[ doc( alias = "realloc" ) ]
923
930
#[ unstable( feature = "shrink_to" , reason = "new API" , issue = "56431" ) ]
924
931
pub fn shrink_to ( & mut self , min_capacity : usize ) {
925
932
self . buf . shrink_to_fit ( cmp:: max ( self . len , min_capacity) ) ;
0 commit comments