@@ -223,6 +223,7 @@ impl<K, V> HashMap<K, V, RandomState> {
223
223
/// let mut map: HashMap<&str, i32> = HashMap::new();
224
224
/// ```
225
225
#[ inline]
226
+ #[ must_use]
226
227
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
227
228
pub fn new ( ) -> HashMap < K , V , RandomState > {
228
229
Default :: default ( )
@@ -240,6 +241,7 @@ impl<K, V> HashMap<K, V, RandomState> {
240
241
/// let mut map: HashMap<&str, i32> = HashMap::with_capacity(10);
241
242
/// ```
242
243
#[ inline]
244
+ #[ must_use]
243
245
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
244
246
pub fn with_capacity ( capacity : usize ) -> HashMap < K , V , RandomState > {
245
247
HashMap :: with_capacity_and_hasher ( capacity, Default :: default ( ) )
@@ -2891,6 +2893,7 @@ impl RandomState {
2891
2893
#[ inline]
2892
2894
#[ allow( deprecated) ]
2893
2895
// rand
2896
+ #[ must_use]
2894
2897
#[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
2895
2898
pub fn new ( ) -> RandomState {
2896
2899
// Historically this function did not cache keys from the OS and instead
@@ -2943,6 +2946,7 @@ impl DefaultHasher {
2943
2946
/// instances created through `new` or `default`.
2944
2947
#[ stable( feature = "hashmap_default_hasher" , since = "1.13.0" ) ]
2945
2948
#[ allow( deprecated) ]
2949
+ #[ must_use]
2946
2950
pub fn new ( ) -> DefaultHasher {
2947
2951
DefaultHasher ( SipHasher13 :: new_with_keys ( 0 , 0 ) )
2948
2952
}
0 commit comments