]> git.lizzy.rs Git - rust.git/commitdiff
Clarify that ordering is unspecified
authorMario Carneiro <di.gama@gmail.com>
Wed, 5 Jan 2022 05:32:20 +0000 (21:32 -0800)
committerGitHub <noreply@github.com>
Wed, 5 Jan 2022 05:32:20 +0000 (21:32 -0800)
library/alloc/src/slice.rs

index 020dfcbaac684ab5f0f3646a0985262df66cde93..d03ae2d5c15197c85868ac09a6121e367471693d 100644 (file)
@@ -373,6 +373,8 @@ pub fn sort_by_key<K, F>(&mut self, mut f: F)
     ///
     /// 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*).