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.
This commit is contained in:
bors 2017-07-07 12:54:46 +00:00
commit 703341051d

View File

@ -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);