From c7fc6db68a7050d9108d0f02de517ff24c5c7b03 Mon Sep 17 00:00:00 2001 From: Ryan Thomas Date: Thu, 6 Jul 2017 20:25:53 +0100 Subject: [PATCH] Add annotations to the resize fn #39791 This adds the `inline(never)` and `cold` annotations to the HashMap::resize function. --- src/libstd/collections/hash/map.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 31efae18816..746e18047f9 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -754,6 +754,8 @@ impl HashMap /// 1) Ensure `new_raw_cap` is enough for all the elements, accounting /// for the load factor. /// 2) Ensure `new_raw_cap` is a power of two or zero. + #[inline(never)] + #[cold] fn resize(&mut self, new_raw_cap: usize) { assert!(self.table.size() <= new_raw_cap); assert!(new_raw_cap.is_power_of_two() || new_raw_cap == 0);