@@ -969,7 +969,6 @@ where
969969 /// # Examples
970970 ///
971971 /// ```
972- /// #![feature(map_many_mut)]
973972 /// use std::collections::HashMap;
974973 ///
975974 /// let mut libraries = HashMap::new();
@@ -979,13 +978,13 @@ where
979978 /// libraries.insert("Library of Congress".to_string(), 1800);
980979 ///
981980 /// // Get Athenæum and Bodleian Library
982- /// let [Some(a), Some(b)] = libraries.get_many_mut ([
981+ /// let [Some(a), Some(b)] = libraries.get_disjoint_mut ([
983982 /// "Athenæum",
984983 /// "Bodleian Library",
985984 /// ]) else { panic!() };
986985 ///
987986 /// // Assert values of Athenæum and Library of Congress
988- /// let got = libraries.get_many_mut ([
987+ /// let got = libraries.get_disjoint_mut ([
989988 /// "Athenæum",
990989 /// "Library of Congress",
991990 /// ]);
@@ -998,7 +997,7 @@ where
998997 /// );
999998 ///
1000999 /// // Missing keys result in None
1001- /// let got = libraries.get_many_mut ([
1000+ /// let got = libraries.get_disjoint_mut ([
10021001 /// "Athenæum",
10031002 /// "New York Public Library",
10041003 /// ]);
@@ -1012,21 +1011,24 @@ where
10121011 /// ```
10131012 ///
10141013 /// ```should_panic
1015- /// #![feature(map_many_mut)]
10161014 /// use std::collections::HashMap;
10171015 ///
10181016 /// let mut libraries = HashMap::new();
10191017 /// libraries.insert("Athenæum".to_string(), 1807);
10201018 ///
10211019 /// // Duplicate keys panic!
1022- /// let got = libraries.get_many_mut ([
1020+ /// let got = libraries.get_disjoint_mut ([
10231021 /// "Athenæum",
10241022 /// "Athenæum",
10251023 /// ]);
10261024 /// ```
10271025 #[ inline]
1028- #[ unstable( feature = "map_many_mut" , issue = "97601" ) ]
1029- pub fn get_many_mut < Q : ?Sized , const N : usize > ( & mut self , ks : [ & Q ; N ] ) -> [ Option < & ' _ mut V > ; N ]
1026+ #[ doc( alias = "get_many_mut" ) ]
1027+ #[ stable( feature = "map_many_mut" , since = "CURRENT_RUSTC_VERSION" ) ]
1028+ pub fn get_disjoint_mut < Q : ?Sized , const N : usize > (
1029+ & mut self ,
1030+ ks : [ & Q ; N ] ,
1031+ ) -> [ Option < & ' _ mut V > ; N ]
10301032 where
10311033 K : Borrow < Q > ,
10321034 Q : Hash + Eq ,
@@ -1040,7 +1042,7 @@ where
10401042 /// Returns an array of length `N` with the results of each query. `None` will be used if
10411043 /// the key is missing.
10421044 ///
1043- /// For a safe alternative see [`get_many_mut `](`HashMap::get_many_mut `).
1045+ /// For a safe alternative see [`get_disjoint_mut `](`HashMap::get_disjoint_mut `).
10441046 ///
10451047 /// # Safety
10461048 ///
@@ -1052,7 +1054,6 @@ where
10521054 /// # Examples
10531055 ///
10541056 /// ```
1055- /// #![feature(map_many_mut)]
10561057 /// use std::collections::HashMap;
10571058 ///
10581059 /// let mut libraries = HashMap::new();
@@ -1062,13 +1063,13 @@ where
10621063 /// libraries.insert("Library of Congress".to_string(), 1800);
10631064 ///
10641065 /// // SAFETY: The keys do not overlap.
1065- /// let [Some(a), Some(b)] = (unsafe { libraries.get_many_unchecked_mut ([
1066+ /// let [Some(a), Some(b)] = (unsafe { libraries.get_disjoint_unchecked_mut ([
10661067 /// "Athenæum",
10671068 /// "Bodleian Library",
10681069 /// ]) }) else { panic!() };
10691070 ///
10701071 /// // SAFETY: The keys do not overlap.
1071- /// let got = unsafe { libraries.get_many_unchecked_mut ([
1072+ /// let got = unsafe { libraries.get_disjoint_unchecked_mut ([
10721073 /// "Athenæum",
10731074 /// "Library of Congress",
10741075 /// ]) };
@@ -1081,16 +1082,17 @@ where
10811082 /// );
10821083 ///
10831084 /// // SAFETY: The keys do not overlap.
1084- /// let got = unsafe { libraries.get_many_unchecked_mut ([
1085+ /// let got = unsafe { libraries.get_disjoint_unchecked_mut ([
10851086 /// "Athenæum",
10861087 /// "New York Public Library",
10871088 /// ]) };
10881089 /// // Missing keys result in None
10891090 /// assert_eq!(got, [Some(&mut 1807), None]);
10901091 /// ```
10911092 #[ inline]
1092- #[ unstable( feature = "map_many_mut" , issue = "97601" ) ]
1093- pub unsafe fn get_many_unchecked_mut < Q : ?Sized , const N : usize > (
1093+ #[ doc( alias = "get_many_unchecked_mut" ) ]
1094+ #[ stable( feature = "map_many_mut" , since = "CURRENT_RUSTC_VERSION" ) ]
1095+ pub unsafe fn get_disjoint_unchecked_mut < Q : ?Sized , const N : usize > (
10941096 & mut self ,
10951097 ks : [ & Q ; N ] ,
10961098 ) -> [ Option < & ' _ mut V > ; N ]
0 commit comments