@@ -223,6 +223,7 @@ impl<K, V> HashMap<K, V, RandomState> {
223223 /// let mut map: HashMap<&str, i32> = HashMap::new();
224224 /// ```
225225 #[ inline]
226+ #[ must_use]
226227 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
227228 pub fn new ( ) -> HashMap < K , V , RandomState > {
228229 Default :: default ( )
@@ -240,6 +241,7 @@ impl<K, V> HashMap<K, V, RandomState> {
240241 /// let mut map: HashMap<&str, i32> = HashMap::with_capacity(10);
241242 /// ```
242243 #[ inline]
244+ #[ must_use]
243245 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
244246 pub fn with_capacity ( capacity : usize ) -> HashMap < K , V , RandomState > {
245247 HashMap :: with_capacity_and_hasher ( capacity, Default :: default ( ) )
@@ -2894,6 +2896,7 @@ impl RandomState {
28942896 #[ inline]
28952897 #[ allow( deprecated) ]
28962898 // rand
2899+ #[ must_use]
28972900 #[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
28982901 pub fn new ( ) -> RandomState {
28992902 // Historically this function did not cache keys from the OS and instead
@@ -2946,6 +2949,7 @@ impl DefaultHasher {
29462949 /// instances created through `new` or `default`.
29472950 #[ stable( feature = "hashmap_default_hasher" , since = "1.13.0" ) ]
29482951 #[ allow( deprecated) ]
2952+ #[ must_use]
29492953 pub fn new ( ) -> DefaultHasher {
29502954 DefaultHasher ( SipHasher13 :: new_with_keys ( 0 , 0 ) )
29512955 }
0 commit comments