about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorxizheyin <xizheyin@smail.nju.edu.cn>2025-04-03 16:19:46 +0800
committerxizheyin <xizheyin@smail.nju.edu.cn>2025-04-05 11:27:03 +0800
commitfe03f76794989508a92af17d2cf519249fae825d (patch)
treead21fa4ad91d11019a329074c516a5b30100b882 /library/std
parentae8ab87de4d8caab5d91a027bc19bb5d5e8a3691 (diff)
downloadrust-fe03f76794989508a92af17d2cf519249fae825d.tar.gz
rust-fe03f76794989508a92af17d2cf519249fae825d.zip
std: Add performance warnings to HashMap::get_disjoint_mut
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/collections/hash/map.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs
index 2487f5a2a50..863d5a40997 100644
--- a/library/std/src/collections/hash/map.rs
+++ b/library/std/src/collections/hash/map.rs
@@ -973,6 +973,9 @@ where
     /// Returns an array of length `N` with the results of each query. For soundness, at most one
     /// mutable reference will be returned to any value. `None` will be used if the key is missing.
     ///
+    /// This method performs a check to ensure there are no duplicate keys, which has time-complexity O(n^2),
+    /// so be careful when passing many keys.
+    ///
     /// # Panics
     ///
     /// Panics if any keys are overlapping.