@@ -788,15 +788,12 @@ impl<T> [T] {
788788 /// # Examples
789789 ///
790790 /// ```rust
791- /// #![feature(slice_sort_by_key)]
792- ///
793791 /// let mut v = [-5i32, 4, 1, -3, 2];
794792 ///
795793 /// v.sort_by_key(|k| k.abs());
796794 /// assert!(v == [1, 2, -3, 4, -5]);
797795 /// ```
798- #[ unstable( feature = "slice_sort_by_key" , reason = "recently added" ,
799- issue = "27724" ) ]
796+ #[ stable( feature = "slice_sort_by_key" , since = "1.7.0" ) ]
800797 #[ inline]
801798 pub fn sort_by_key < B , F > ( & mut self , mut f : F )
802799 where F : FnMut ( & T ) -> B , B : Ord
@@ -829,29 +826,25 @@ impl<T> [T] {
829826 merge_sort ( self , compare)
830827 }
831828
832- /// Copies as many elements from `src` as it can into `self` (the
833- /// shorter of `self.len()` and `src.len()`). Returns the number
834- /// of elements copied.
829+ /// Copies the elements from `src` into `self`.
830+ ///
831+ /// The length of this slice must be the same as the slice passed in.
832+ ///
833+ /// # Panics
834+ ///
835+ /// This function will panic if the two slices have different lengths.
835836 ///
836837 /// # Example
837838 ///
838839 /// ```rust
839- /// #![feature(clone_from_slice)]
840- ///
841840 /// let mut dst = [0, 0, 0];
842- /// let src = [1, 2];
843- ///
844- /// assert!(dst.clone_from_slice(&src) == 2);
845- /// assert!(dst == [1, 2, 0]);
841+ /// let src = [1, 2, 3];
846842 ///
847- /// let src2 = [3, 4, 5, 6];
848- /// assert!(dst.clone_from_slice(&src2) == 3);
849- /// assert!(dst == [3, 4, 5]);
843+ /// dst.clone_from_slice(&src);
844+ /// assert!(dst == [1, 2, 3]);
850845 /// ```
851- #[ unstable( feature = "clone_from_slice" , issue = "27750" ) ]
852- pub fn clone_from_slice ( & mut self , src : & [ T ] ) -> usize
853- where T : Clone
854- {
846+ #[ stable( feature = "clone_from_slice" , since = "1.7.0" ) ]
847+ pub fn clone_from_slice ( & mut self , src : & [ T ] ) where T : Clone {
855848 core_slice:: SliceExt :: clone_from_slice ( self , src)
856849 }
857850
0 commit comments