@@ -433,6 +433,7 @@ impl<T> Vec<T> {
433433 /// assert!(vec.capacity() >= 11);
434434 /// ```
435435 #[ inline]
436+ #[ doc( alias = "malloc" ) ]
436437 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
437438 pub fn with_capacity ( capacity : usize ) -> Self {
438439 Self :: with_capacity_in ( capacity, Global )
@@ -766,6 +767,7 @@ impl<T, A: Allocator> Vec<T, A> {
766767 /// vec.reserve(10);
767768 /// assert!(vec.capacity() >= 11);
768769 /// ```
770+ #[ doc( alias = "realloc" ) ]
769771 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
770772 pub fn reserve ( & mut self , additional : usize ) {
771773 self . buf . reserve ( self . len , additional) ;
@@ -791,6 +793,7 @@ impl<T, A: Allocator> Vec<T, A> {
791793 /// vec.reserve_exact(10);
792794 /// assert!(vec.capacity() >= 11);
793795 /// ```
796+ #[ doc( alias = "realloc" ) ]
794797 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
795798 pub fn reserve_exact ( & mut self , additional : usize ) {
796799 self . buf . reserve_exact ( self . len , additional) ;
@@ -828,6 +831,7 @@ impl<T, A: Allocator> Vec<T, A> {
828831 /// }
829832 /// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
830833 /// ```
834+ #[ doc( alias = "realloc" ) ]
831835 #[ unstable( feature = "try_reserve" , reason = "new API" , issue = "48043" ) ]
832836 pub fn try_reserve ( & mut self , additional : usize ) -> Result < ( ) , TryReserveError > {
833837 self . buf . try_reserve ( self . len , additional)
@@ -869,6 +873,7 @@ impl<T, A: Allocator> Vec<T, A> {
869873 /// }
870874 /// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
871875 /// ```
876+ #[ doc( alias = "realloc" ) ]
872877 #[ unstable( feature = "try_reserve" , reason = "new API" , issue = "48043" ) ]
873878 pub fn try_reserve_exact ( & mut self , additional : usize ) -> Result < ( ) , TryReserveError > {
874879 self . buf . try_reserve_exact ( self . len , additional)
@@ -888,6 +893,7 @@ impl<T, A: Allocator> Vec<T, A> {
888893 /// vec.shrink_to_fit();
889894 /// assert!(vec.capacity() >= 3);
890895 /// ```
896+ #[ doc( alias = "realloc" ) ]
891897 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
892898 pub fn shrink_to_fit ( & mut self ) {
893899 // 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> {
920926 /// vec.shrink_to(0);
921927 /// assert!(vec.capacity() >= 3);
922928 /// ```
929+ #[ doc( alias = "realloc" ) ]
923930 #[ unstable( feature = "shrink_to" , reason = "new API" , issue = "56431" ) ]
924931 pub fn shrink_to ( & mut self , min_capacity : usize ) {
925932 self . buf . shrink_to_fit ( cmp:: max ( self . len , min_capacity) ) ;
0 commit comments