about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-07 12:54:46 +0000
committerbors <bors@rust-lang.org>2017-07-07 12:54:46 +0000
commit703341051d857bba054f97c38f80d10aab44521c (patch)
tree564d3dd75d2bf0f5ebc347ec7cd2df33edcc1892 /src
parent70412af2850bca405f516fbb51f01d6b7fdb74c0 (diff)
parentc7fc6db68a7050d9108d0f02de517ff24c5c7b03 (diff)
downloadrust-703341051d857bba054f97c38f80d10aab44521c.tar.gz
rust-703341051d857bba054f97c38f80d10aab44521c.zip
Auto merge of #43093 - rthomas:39791-hashmap, r=alexcrichton
Add annotations to the resize fn #39791

This adds the `inline(never)` and `cold` annotations to the
HashMap::resize function.
Diffstat (limited to 'src')
-rw-r--r--src/libstd/collections/hash/map.rs2
1 files changed, 2 insertions, 0 deletions
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<K, V, S> HashMap<K, V, S>
     ///   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);