@@ -1144,6 +1144,10 @@ impl<T> [T] {
11441144 ///
11451145 /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
11461146 ///
1147+ /// When applicable, unstable sorting is preferred because it is generally faster than stable
1148+ /// sorting and it doesn't allocate auxiliary memory.
1149+ /// See [`sort_unstable`](#method.sort_unstable).
1150+ ///
11471151 /// # Current implementation
11481152 ///
11491153 /// The current algorithm is an adaptive, iterative merge sort inspired by
@@ -1174,6 +1178,10 @@ impl<T> [T] {
11741178 ///
11751179 /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
11761180 ///
1181+ /// When applicable, unstable sorting is preferred because it is generally faster than stable
1182+ /// sorting and it doesn't allocate auxiliary memory.
1183+ /// See [`sort_unstable_by`](#method.sort_unstable_by).
1184+ ///
11771185 /// # Current implementation
11781186 ///
11791187 /// The current algorithm is an adaptive, iterative merge sort inspired by
@@ -1207,6 +1215,10 @@ impl<T> [T] {
12071215 ///
12081216 /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
12091217 ///
1218+ /// When applicable, unstable sorting is preferred because it is generally faster than stable
1219+ /// sorting and it doesn't allocate auxiliary memory.
1220+ /// See [`sort_unstable_by_key`](#method.sort_unstable_by_key).
1221+ ///
12101222 /// # Current implementation
12111223 ///
12121224 /// The current algorithm is an adaptive, iterative merge sort inspired by
@@ -1251,17 +1263,14 @@ impl<T> [T] {
12511263 /// # Examples
12521264 ///
12531265 /// ```
1254- /// #![feature(sort_unstable)]
1255- ///
12561266 /// let mut v = [-5, 4, 1, -3, 2];
12571267 ///
12581268 /// v.sort_unstable();
12591269 /// assert!(v == [-5, -3, 1, 2, 4]);
12601270 /// ```
12611271 ///
12621272 /// [pdqsort]: https://github.com/orlp/pdqsort
1263- // FIXME #40585: Mention `sort_unstable` in the documentation for `sort`.
1264- #[ unstable( feature = "sort_unstable" , issue = "40585" ) ]
1273+ #[ stable( feature = "sort_unstable" , since = "1.20.0" ) ]
12651274 #[ inline]
12661275 pub fn sort_unstable ( & mut self )
12671276 where T : Ord
@@ -1288,8 +1297,6 @@ impl<T> [T] {
12881297 /// # Examples
12891298 ///
12901299 /// ```
1291- /// #![feature(sort_unstable)]
1292- ///
12931300 /// let mut v = [5, 4, 1, 3, 2];
12941301 /// v.sort_unstable_by(|a, b| a.cmp(b));
12951302 /// assert!(v == [1, 2, 3, 4, 5]);
@@ -1300,8 +1307,7 @@ impl<T> [T] {
13001307 /// ```
13011308 ///
13021309 /// [pdqsort]: https://github.com/orlp/pdqsort
1303- // FIXME #40585: Mention `sort_unstable_by` in the documentation for `sort_by`.
1304- #[ unstable( feature = "sort_unstable" , issue = "40585" ) ]
1310+ #[ stable( feature = "sort_unstable" , since = "1.20.0" ) ]
13051311 #[ inline]
13061312 pub fn sort_unstable_by < F > ( & mut self , compare : F )
13071313 where F : FnMut ( & T , & T ) -> Ordering
@@ -1328,17 +1334,14 @@ impl<T> [T] {
13281334 /// # Examples
13291335 ///
13301336 /// ```
1331- /// #![feature(sort_unstable)]
1332- ///
13331337 /// let mut v = [-5i32, 4, 1, -3, 2];
13341338 ///
13351339 /// v.sort_unstable_by_key(|k| k.abs());
13361340 /// assert!(v == [1, 2, -3, 4, -5]);
13371341 /// ```
13381342 ///
13391343 /// [pdqsort]: https://github.com/orlp/pdqsort
1340- // FIXME #40585: Mention `sort_unstable_by_key` in the documentation for `sort_by_key`.
1341- #[ unstable( feature = "sort_unstable" , issue = "40585" ) ]
1344+ #[ stable( feature = "sort_unstable" , since = "1.20.0" ) ]
13421345 #[ inline]
13431346 pub fn sort_unstable_by_key < B , F > ( & mut self , f : F )
13441347 where F : FnMut ( & T ) -> B ,
0 commit comments