about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/alloc/src/slice.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs
index 8853577371a..a5c4140e313 100644
--- a/library/alloc/src/slice.rs
+++ b/library/alloc/src/slice.rs
@@ -375,7 +375,10 @@ impl<T> [T] {
 
     /// Sorts the slice with a key extraction function.
     ///
-    /// During sorting, the key function is called only once per element.
+    /// During sorting, the key function is called at most once per element, by using
+    /// temporary storage to remember the results of key evaluation.
+    /// The order of calls to the key function is unspecified and may change in future versions
+    /// of the standard library.
     ///
     /// This sort is stable (i.e., does not reorder equal elements) and *O*(*m* \* *n* + *n* \* log(*n*))
     /// worst-case, where the key function is *O*(*m*).