@@ -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 ( ) )
@@ -2891,6 +2893,7 @@ impl RandomState {
28912893 #[ inline]
28922894 #[ allow( deprecated) ]
28932895 // rand
2896+ #[ must_use]
28942897 #[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
28952898 pub fn new ( ) -> RandomState {
28962899 // Historically this function did not cache keys from the OS and instead
@@ -2943,6 +2946,7 @@ impl DefaultHasher {
29432946 /// instances created through `new` or `default`.
29442947 #[ stable( feature = "hashmap_default_hasher" , since = "1.13.0" ) ]
29452948 #[ allow( deprecated) ]
2949+ #[ must_use]
29462950 pub fn new ( ) -> DefaultHasher {
29472951 DefaultHasher ( SipHasher13 :: new_with_keys ( 0 , 0 ) )
29482952 }
0 commit comments