about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorRyan Thomas <ryan@ryant.org>2017-07-06 20:25:53 +0100
committerRyan Thomas <ryan@ryant.org>2017-07-06 20:32:47 +0100
commitc7fc6db68a7050d9108d0f02de517ff24c5c7b03 (patch)
treeb321eb97d226af4c5c0ba9f874d9faa107907a95 /src/libstd
parent54fc9e4ea587ad3ebb3ccb5c409ccfa9e4b09b3d (diff)
downloadrust-c7fc6db68a7050d9108d0f02de517ff24c5c7b03.tar.gz
rust-c7fc6db68a7050d9108d0f02de517ff24c5c7b03.zip
Add annotations to the resize fn #39791
This adds the `inline(never)` and `cold` annotations to the
HashMap::resize function.
Diffstat (limited to 'src/libstd')
-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);