@@ -1571,7 +1571,7 @@ impl<K, V, S> HashMap<K, V, S>
1571
1571
/// so that the map now contains keys which compare equal, search may start
1572
1572
/// acting erratically, with two keys randomly masking each other. Implementations
1573
1573
/// are free to assume this doesn't happen (within the limits of memory-safety).
1574
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1574
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1575
1575
pub fn raw_entry_mut ( & mut self ) -> RawEntryBuilderMut < K , V , S > {
1576
1576
self . reserve ( 1 ) ;
1577
1577
RawEntryBuilderMut { map : self }
@@ -1592,7 +1592,7 @@ impl<K, V, S> HashMap<K, V, S>
1592
1592
/// `get` should be preferred.
1593
1593
///
1594
1594
/// Immutable raw entries have very limited use; you might instead want `raw_entry_mut`.
1595
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1595
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1596
1596
pub fn raw_entry ( & self ) -> RawEntryBuilder < K , V , S > {
1597
1597
RawEntryBuilder { map : self }
1598
1598
}
@@ -1844,7 +1844,7 @@ impl<'a, K, V> InternalEntry<K, V, &'a mut RawTable<K, V>> {
1844
1844
///
1845
1845
/// [`HashMap::raw_entry_mut`]: struct.HashMap.html#method.raw_entry_mut
1846
1846
1847
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1847
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1848
1848
pub struct RawEntryBuilderMut < ' a , K : ' a , V : ' a , S : ' a > {
1849
1849
map : & ' a mut HashMap < K , V , S > ,
1850
1850
}
@@ -1858,7 +1858,7 @@ pub struct RawEntryBuilderMut<'a, K: 'a, V: 'a, S: 'a> {
1858
1858
/// [`HashMap`]: struct.HashMap.html
1859
1859
/// [`Entry`]: enum.Entry.html
1860
1860
/// [`raw_entry`]: struct.HashMap.html#method.raw_entry
1861
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1861
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1862
1862
pub enum RawEntryMut < ' a , K : ' a , V : ' a , S : ' a > {
1863
1863
/// An occupied entry.
1864
1864
Occupied ( RawOccupiedEntryMut < ' a , K , V > ) ,
@@ -1870,7 +1870,7 @@ pub enum RawEntryMut<'a, K: 'a, V: 'a, S: 'a> {
1870
1870
/// It is part of the [`RawEntryMut`] enum.
1871
1871
///
1872
1872
/// [`RawEntryMut`]: enum.RawEntryMut.html
1873
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1873
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1874
1874
pub struct RawOccupiedEntryMut < ' a , K : ' a , V : ' a > {
1875
1875
elem : FullBucket < K , V , & ' a mut RawTable < K , V > > ,
1876
1876
}
@@ -1879,7 +1879,7 @@ pub struct RawOccupiedEntryMut<'a, K: 'a, V: 'a> {
1879
1879
/// It is part of the [`RawEntryMut`] enum.
1880
1880
///
1881
1881
/// [`RawEntryMut`]: enum.RawEntryMut.html
1882
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1882
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1883
1883
pub struct RawVacantEntryMut < ' a , K : ' a , V : ' a , S : ' a > {
1884
1884
elem : VacantEntryState < K , V , & ' a mut RawTable < K , V > > ,
1885
1885
hash_builder : & ' a S ,
@@ -1890,7 +1890,7 @@ pub struct RawVacantEntryMut<'a, K: 'a, V: 'a, S: 'a> {
1890
1890
/// See the [`HashMap::raw_entry`] docs for usage examples.
1891
1891
///
1892
1892
/// [`HashMap::raw_entry`]: struct.HashMap.html#method.raw_entry
1893
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1893
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1894
1894
pub struct RawEntryBuilder < ' a , K : ' a , V : ' a , S : ' a > {
1895
1895
map : & ' a HashMap < K , V , S > ,
1896
1896
}
@@ -1900,7 +1900,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1900
1900
K : Eq + Hash ,
1901
1901
{
1902
1902
/// Create a `RawEntryMut` from the given key.
1903
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1903
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1904
1904
pub fn from_key < Q : ?Sized > ( self , k : & Q ) -> RawEntryMut < ' a , K , V , S >
1905
1905
where K : Borrow < Q > ,
1906
1906
Q : Hash + Eq
@@ -1911,7 +1911,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1911
1911
}
1912
1912
1913
1913
/// Create a `RawEntryMut` from the given key and its hash.
1914
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1914
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1915
1915
pub fn from_key_hashed_nocheck < Q : ?Sized > ( self , hash : u64 , k : & Q ) -> RawEntryMut < ' a , K , V , S >
1916
1916
where K : Borrow < Q > ,
1917
1917
Q : Eq
@@ -1941,7 +1941,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1941
1941
}
1942
1942
}
1943
1943
/// Create a `RawEntryMut` from the given hash.
1944
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1944
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1945
1945
pub fn from_hash < F > ( self , hash : u64 , is_match : F ) -> RawEntryMut < ' a , K , V , S >
1946
1946
where for < ' b > F : FnMut ( & ' b K ) -> bool ,
1947
1947
{
@@ -1951,7 +1951,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1951
1951
/// Search possible locations for an element with hash `hash` until `is_match` returns true for
1952
1952
/// one of them. There is no guarantee that all keys passed to `is_match` will have the provided
1953
1953
/// hash.
1954
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1954
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1955
1955
pub fn search_bucket < F > ( self , hash : u64 , is_match : F ) -> RawEntryMut < ' a , K , V , S >
1956
1956
where for < ' b > F : FnMut ( & ' b K ) -> bool ,
1957
1957
{
@@ -1963,7 +1963,7 @@ impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S>
1963
1963
where S : BuildHasher ,
1964
1964
{
1965
1965
/// Access an entry by key.
1966
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1966
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1967
1967
pub fn from_key < Q : ?Sized > ( self , k : & Q ) -> Option < ( & ' a K , & ' a V ) >
1968
1968
where K : Borrow < Q > ,
1969
1969
Q : Hash + Eq
@@ -1974,7 +1974,7 @@ impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S>
1974
1974
}
1975
1975
1976
1976
/// Access an entry by a key and its hash.
1977
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
1977
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
1978
1978
pub fn from_key_hashed_nocheck < Q : ?Sized > ( self , hash : u64 , k : & Q ) -> Option < ( & ' a K , & ' a V ) >
1979
1979
where K : Borrow < Q > ,
1980
1980
Q : Hash + Eq
@@ -1997,7 +1997,7 @@ impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S>
1997
1997
}
1998
1998
1999
1999
/// Access an entry by hash.
2000
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2000
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2001
2001
pub fn from_hash < F > ( self , hash : u64 , is_match : F ) -> Option < ( & ' a K , & ' a V ) >
2002
2002
where F : FnMut ( & K ) -> bool
2003
2003
{
@@ -2007,7 +2007,7 @@ impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S>
2007
2007
/// Search possible locations for an element with hash `hash` until `is_match` returns true for
2008
2008
/// one of them. There is no guarantee that all keys passed to `is_match` will have the provided
2009
2009
/// hash.
2010
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2010
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2011
2011
pub fn search_bucket < F > ( self , hash : u64 , is_match : F ) -> Option < ( & ' a K , & ' a V ) >
2012
2012
where F : FnMut ( & K ) -> bool
2013
2013
{
@@ -2033,7 +2033,7 @@ impl<'a, K, V, S> RawEntryMut<'a, K, V, S> {
2033
2033
/// *map.raw_entry_mut().from_key("poneyland").or_insert("poneyland", 10).1 *= 2;
2034
2034
/// assert_eq!(map["poneyland"], 6);
2035
2035
/// ```
2036
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2036
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2037
2037
pub fn or_insert ( self , default_key : K , default_val : V ) -> ( & ' a mut K , & ' a mut V )
2038
2038
where K : Hash ,
2039
2039
S : BuildHasher ,
@@ -2061,7 +2061,7 @@ impl<'a, K, V, S> RawEntryMut<'a, K, V, S> {
2061
2061
///
2062
2062
/// assert_eq!(map["poneyland"], "hoho".to_string());
2063
2063
/// ```
2064
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2064
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2065
2065
pub fn or_insert_with < F > ( self , default : F ) -> ( & ' a mut K , & ' a mut V )
2066
2066
where F : FnOnce ( ) -> ( K , V ) ,
2067
2067
K : Hash ,
@@ -2099,7 +2099,7 @@ impl<'a, K, V, S> RawEntryMut<'a, K, V, S> {
2099
2099
/// .or_insert("poneyland", 0);
2100
2100
/// assert_eq!(map["poneyland"], 43);
2101
2101
/// ```
2102
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2102
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2103
2103
pub fn and_modify < F > ( self , f : F ) -> Self
2104
2104
where F : FnOnce ( & mut K , & mut V )
2105
2105
{
@@ -2118,82 +2118,82 @@ impl<'a, K, V, S> RawEntryMut<'a, K, V, S> {
2118
2118
2119
2119
impl < ' a , K , V > RawOccupiedEntryMut < ' a , K , V > {
2120
2120
/// Gets a reference to the key in the entry.
2121
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2121
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2122
2122
pub fn key ( & self ) -> & K {
2123
2123
self . elem . read ( ) . 0
2124
2124
}
2125
2125
2126
2126
/// Gets a mutable reference to the key in the entry.
2127
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2127
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2128
2128
pub fn key_mut ( & mut self ) -> & mut K {
2129
2129
self . elem . read_mut ( ) . 0
2130
2130
}
2131
2131
2132
2132
/// Converts the entry into a mutable reference to the key in the entry
2133
2133
/// with a lifetime bound to the map itself.
2134
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2134
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2135
2135
pub fn into_key ( self ) -> & ' a mut K {
2136
2136
self . elem . into_mut_refs ( ) . 0
2137
2137
}
2138
2138
2139
2139
/// Gets a reference to the value in the entry.
2140
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2140
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2141
2141
pub fn get ( & self ) -> & V {
2142
2142
self . elem . read ( ) . 1
2143
2143
}
2144
2144
2145
2145
/// Converts the OccupiedEntry into a mutable reference to the value in the entry
2146
2146
/// with a lifetime bound to the map itself.
2147
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2147
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2148
2148
pub fn into_mut ( self ) -> & ' a mut V {
2149
2149
self . elem . into_mut_refs ( ) . 1
2150
2150
}
2151
2151
2152
2152
/// Gets a mutable reference to the value in the entry.
2153
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2153
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2154
2154
pub fn get_mut ( & mut self ) -> & mut V {
2155
2155
self . elem . read_mut ( ) . 1
2156
2156
}
2157
2157
2158
2158
/// Gets a reference to the key and value in the entry.
2159
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2159
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2160
2160
pub fn get_key_value ( & mut self ) -> ( & K , & V ) {
2161
2161
self . elem . read ( )
2162
2162
}
2163
2163
2164
2164
/// Gets a mutable reference to the key and value in the entry.
2165
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2165
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2166
2166
pub fn get_key_value_mut ( & mut self ) -> ( & mut K , & mut V ) {
2167
2167
self . elem . read_mut ( )
2168
2168
}
2169
2169
2170
2170
/// Converts the OccupiedEntry into a mutable reference to the key and value in the entry
2171
2171
/// with a lifetime bound to the map itself.
2172
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2172
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2173
2173
pub fn into_key_value ( self ) -> ( & ' a mut K , & ' a mut V ) {
2174
2174
self . elem . into_mut_refs ( )
2175
2175
}
2176
2176
2177
2177
/// Sets the value of the entry, and returns the entry's old value.
2178
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2178
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2179
2179
pub fn insert ( & mut self , value : V ) -> V {
2180
2180
mem:: replace ( self . get_mut ( ) , value)
2181
2181
}
2182
2182
2183
2183
/// Sets the value of the entry, and returns the entry's old value.
2184
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2184
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2185
2185
pub fn insert_key ( & mut self , key : K ) -> K {
2186
2186
mem:: replace ( self . key_mut ( ) , key)
2187
2187
}
2188
2188
2189
2189
/// Takes the value out of the entry, and returns it.
2190
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2190
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2191
2191
pub fn remove ( self ) -> V {
2192
2192
pop_internal ( self . elem ) . 1
2193
2193
}
2194
2194
2195
2195
/// Take the ownership of the key and value from the map.
2196
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2196
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2197
2197
pub fn remove_entry ( self ) -> ( K , V ) {
2198
2198
let ( k, v, _) = pop_internal ( self . elem ) ;
2199
2199
( k, v)
@@ -2203,7 +2203,7 @@ impl<'a, K, V> RawOccupiedEntryMut<'a, K, V> {
2203
2203
impl < ' a , K , V , S > RawVacantEntryMut < ' a , K , V , S > {
2204
2204
/// Sets the value of the entry with the VacantEntry's key,
2205
2205
/// and returns a mutable reference to it.
2206
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2206
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2207
2207
pub fn insert ( self , key : K , value : V ) -> ( & ' a mut K , & ' a mut V )
2208
2208
where K : Hash ,
2209
2209
S : BuildHasher ,
@@ -2215,7 +2215,7 @@ impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> {
2215
2215
2216
2216
/// Sets the value of the entry with the VacantEntry's key,
2217
2217
/// and returns a mutable reference to it.
2218
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2218
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2219
2219
pub fn insert_hashed_nocheck ( self , hash : u64 , key : K , value : V ) -> ( & ' a mut K , & ' a mut V ) {
2220
2220
let hash = SafeHash :: new ( hash) ;
2221
2221
let b = match self . elem {
@@ -2236,15 +2236,15 @@ impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> {
2236
2236
}
2237
2237
}
2238
2238
2239
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2239
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2240
2240
impl < ' a , K , V , S > Debug for RawEntryBuilderMut < ' a , K , V , S > {
2241
2241
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2242
2242
f. debug_struct ( "RawEntryBuilder" )
2243
2243
. finish ( )
2244
2244
}
2245
2245
}
2246
2246
2247
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2247
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2248
2248
impl < ' a , K : Debug , V : Debug , S > Debug for RawEntryMut < ' a , K , V , S > {
2249
2249
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2250
2250
match * self {
@@ -2262,7 +2262,7 @@ impl<'a, K: Debug, V: Debug, S> Debug for RawEntryMut<'a, K, V, S> {
2262
2262
}
2263
2263
}
2264
2264
2265
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2265
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2266
2266
impl < ' a , K : Debug , V : Debug > Debug for RawOccupiedEntryMut < ' a , K , V > {
2267
2267
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2268
2268
f. debug_struct ( "RawOccupiedEntryMut" )
@@ -2272,15 +2272,15 @@ impl<'a, K: Debug, V: Debug> Debug for RawOccupiedEntryMut<'a, K, V> {
2272
2272
}
2273
2273
}
2274
2274
2275
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2275
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2276
2276
impl < ' a , K , V , S > Debug for RawVacantEntryMut < ' a , K , V , S > {
2277
2277
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2278
2278
f. debug_struct ( "RawVacantEntryMut" )
2279
2279
. finish ( )
2280
2280
}
2281
2281
}
2282
2282
2283
- #[ unstable( feature = "hash_raw_entry" , issue = "54043 " ) ]
2283
+ #[ unstable( feature = "hash_raw_entry" , issue = "56167 " ) ]
2284
2284
impl < ' a , K , V , S > Debug for RawEntryBuilder < ' a , K , V , S > {
2285
2285
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2286
2286
f. debug_struct ( "RawEntryBuilder" )
0 commit comments