@@ -357,6 +357,7 @@ impl<K, V, S> HashMap<K, V, S> {
357357 /// map.insert(1, 2);
358358 /// ```
359359 #[ inline]
360+ #[ must_use]
360361 #[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
361362 #[ rustc_const_stable( feature = "const_collections_with_hasher" , since = "1.85.0" ) ]
362363 pub const fn with_hasher ( hash_builder : S ) -> HashMap < K , V , S > {
@@ -389,6 +390,7 @@ impl<K, V, S> HashMap<K, V, S> {
389390 /// map.insert(1, 2);
390391 /// ```
391392 #[ inline]
393+ #[ must_use]
392394 #[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
393395 pub fn with_capacity_and_hasher ( capacity : usize , hasher : S ) -> HashMap < K , V , S > {
394396 HashMap { base : base:: HashMap :: with_capacity_and_hasher ( capacity, hasher) }
@@ -409,6 +411,7 @@ impl<K, V, S, A: Allocator> HashMap<K, V, S, A> {
409411 /// The `hash_builder` passed should implement the [`BuildHasher`] trait for
410412 /// the `HashMap` to be useful, see its documentation for details.
411413 #[ inline]
414+ #[ must_use]
412415 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
413416 pub fn with_hasher_in ( hash_builder : S , alloc : A ) -> Self {
414417 HashMap { base : base:: HashMap :: with_hasher_in ( hash_builder, alloc) }
@@ -430,6 +433,7 @@ impl<K, V, S, A: Allocator> HashMap<K, V, S, A> {
430433 /// the `HashMap` to be useful, see its documentation for details.
431434 ///
432435 #[ inline]
436+ #[ must_use]
433437 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
434438 pub fn with_capacity_and_hasher_in ( capacity : usize , hash_builder : S , alloc : A ) -> Self {
435439 HashMap { base : base:: HashMap :: with_capacity_and_hasher_in ( capacity, hash_builder, alloc) }
0 commit comments