@@ -969,7 +969,6 @@ where
969
969
/// # Examples
970
970
///
971
971
/// ```
972
- /// #![feature(map_many_mut)]
973
972
/// use std::collections::HashMap;
974
973
///
975
974
/// let mut libraries = HashMap::new();
@@ -979,13 +978,13 @@ where
979
978
/// libraries.insert("Library of Congress".to_string(), 1800);
980
979
///
981
980
/// // 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 ([
983
982
/// "Athenæum",
984
983
/// "Bodleian Library",
985
984
/// ]) else { panic!() };
986
985
///
987
986
/// // Assert values of Athenæum and Library of Congress
988
- /// let got = libraries.get_many_mut ([
987
+ /// let got = libraries.get_disjoint_mut ([
989
988
/// "Athenæum",
990
989
/// "Library of Congress",
991
990
/// ]);
@@ -998,7 +997,7 @@ where
998
997
/// );
999
998
///
1000
999
/// // Missing keys result in None
1001
- /// let got = libraries.get_many_mut ([
1000
+ /// let got = libraries.get_disjoint_mut ([
1002
1001
/// "Athenæum",
1003
1002
/// "New York Public Library",
1004
1003
/// ]);
@@ -1012,21 +1011,24 @@ where
1012
1011
/// ```
1013
1012
///
1014
1013
/// ```should_panic
1015
- /// #![feature(map_many_mut)]
1016
1014
/// use std::collections::HashMap;
1017
1015
///
1018
1016
/// let mut libraries = HashMap::new();
1019
1017
/// libraries.insert("Athenæum".to_string(), 1807);
1020
1018
///
1021
1019
/// // Duplicate keys panic!
1022
- /// let got = libraries.get_many_mut ([
1020
+ /// let got = libraries.get_disjoint_mut ([
1023
1021
/// "Athenæum",
1024
1022
/// "Athenæum",
1025
1023
/// ]);
1026
1024
/// ```
1027
1025
#[ 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 ]
1030
1032
where
1031
1033
K : Borrow < Q > ,
1032
1034
Q : Hash + Eq ,
@@ -1040,7 +1042,7 @@ where
1040
1042
/// Returns an array of length `N` with the results of each query. `None` will be used if
1041
1043
/// the key is missing.
1042
1044
///
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 `).
1044
1046
///
1045
1047
/// # Safety
1046
1048
///
@@ -1052,7 +1054,6 @@ where
1052
1054
/// # Examples
1053
1055
///
1054
1056
/// ```
1055
- /// #![feature(map_many_mut)]
1056
1057
/// use std::collections::HashMap;
1057
1058
///
1058
1059
/// let mut libraries = HashMap::new();
@@ -1062,13 +1063,13 @@ where
1062
1063
/// libraries.insert("Library of Congress".to_string(), 1800);
1063
1064
///
1064
1065
/// // 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 ([
1066
1067
/// "Athenæum",
1067
1068
/// "Bodleian Library",
1068
1069
/// ]) }) else { panic!() };
1069
1070
///
1070
1071
/// // SAFETY: The keys do not overlap.
1071
- /// let got = unsafe { libraries.get_many_unchecked_mut ([
1072
+ /// let got = unsafe { libraries.get_disjoint_unchecked_mut ([
1072
1073
/// "Athenæum",
1073
1074
/// "Library of Congress",
1074
1075
/// ]) };
@@ -1081,16 +1082,17 @@ where
1081
1082
/// );
1082
1083
///
1083
1084
/// // SAFETY: The keys do not overlap.
1084
- /// let got = unsafe { libraries.get_many_unchecked_mut ([
1085
+ /// let got = unsafe { libraries.get_disjoint_unchecked_mut ([
1085
1086
/// "Athenæum",
1086
1087
/// "New York Public Library",
1087
1088
/// ]) };
1088
1089
/// // Missing keys result in None
1089
1090
/// assert_eq!(got, [Some(&mut 1807), None]);
1090
1091
/// ```
1091
1092
#[ 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 > (
1094
1096
& mut self ,
1095
1097
ks : [ & Q ; N ] ,
1096
1098
) -> [ Option < & ' _ mut V > ; N ]
0 commit comments