From 4901431b02227416b08e5fbc9a7ac3f5ac2f44a7 Mon Sep 17 00:00:00 2001 From: linouxis9 Date: Mon, 7 May 2018 15:31:54 +0200 Subject: Update for latest nightly 2018-05-06 --- ctr-std/src/collections/hash/map.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ctr-std/src/collections/hash/map.rs') diff --git a/ctr-std/src/collections/hash/map.rs b/ctr-std/src/collections/hash/map.rs index 20a4f9b..a7eb002 100644 --- a/ctr-std/src/collections/hash/map.rs +++ b/ctr-std/src/collections/hash/map.rs @@ -11,7 +11,7 @@ use self::Entry::*; use self::VacantEntryState::*; -use alloc::{Global, Alloc, CollectionAllocErr}; +use alloc::{CollectionAllocErr, oom}; use cell::Cell; use borrow::Borrow; use cmp::max; @@ -33,6 +33,7 @@ const MIN_NONZERO_RAW_CAPACITY: usize = 32; // must be a power of two struct DefaultResizePolicy; impl DefaultResizePolicy { + #[inline] fn new() -> DefaultResizePolicy { DefaultResizePolicy } @@ -784,7 +785,7 @@ impl HashMap pub fn reserve(&mut self, additional: usize) { match self.try_reserve(additional) { Err(CollectionAllocErr::CapacityOverflow) => panic!("capacity overflow"), - Err(CollectionAllocErr::AllocErr) => Global.oom(), + Err(CollectionAllocErr::AllocErr) => oom(), Ok(()) => { /* yay */ } } } @@ -1379,7 +1380,6 @@ impl HashMap /// # Examples /// /// ``` - /// #![feature(hash_map_remove_entry)] /// use std::collections::HashMap; /// /// # fn main() { @@ -1389,7 +1389,7 @@ impl HashMap /// assert_eq!(map.remove(&1), None); /// # } /// ``` - #[unstable(feature = "hash_map_remove_entry", issue = "46344")] + #[stable(feature = "hash_map_remove_entry", since = "1.27.0")] pub fn remove_entry(&mut self, k: &Q) -> Option<(K, V)> where K: Borrow, Q: Hash + Eq @@ -2127,8 +2127,8 @@ impl<'a, K, V> Entry<'a, K, V> { /// assert_eq!(map["poneyland"], 43); /// ``` #[stable(feature = "entry_and_modify", since = "1.26.0")] - pub fn and_modify(self, mut f: F) -> Self - where F: FnMut(&mut V) + pub fn and_modify(self, f: F) -> Self + where F: FnOnce(&mut V) { match self { Occupied(mut entry) => { -- cgit v1.2.3