Clarify that ordering is unspecified

This commit is contained in:
Mario Carneiro 2022-01-04 21:32:20 -08:00 committed by GitHub
parent b9f008b1ee
commit 06b17a2181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,6 +373,8 @@ impl<T> [T] {
///
/// 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*).