Skip to content

Commit

Permalink
std: Stabilize APIs for the 1.12 release
Browse files Browse the repository at this point in the history
Stabilized

* `Cell::as_ptr`
* `RefCell::as_ptr`
* `IpAddr::is_{unspecified,loopback,multicast}`
* `Ipv6Addr::octets`
* `LinkedList::contains`
* `VecDeque::contains`
* `ExitStatusExt::from_raw` - both on Unix and Windows
* `Receiver::recv_timeout`
* `RecvTimeoutError`
* `BinaryHeap::peek_mut`
* `PeekMut`
* `iter::Product`
* `iter::Sum`
* `OccupiedEntry::remove_entry`
* `VacantEntry::into_key`

Deprecated

* `Cell::as_unsafe_cell`
* `RefCell::as_unsafe_cell`
* `OccupiedEntry::remove_pair`

Closes #27708
cc #27709
Closes #32313
Closes #32630
Closes #32713
Closes #34029
Closes #34392
Closes #34285
Closes #34529
  • Loading branch information
alexcrichton committed Aug 19, 2016
1 parent 53b8678 commit 47b7f4d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,13 +1640,18 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
self.elem.read().0
}

/// Deprecated, renamed to `remove_entry`
#[unstable(feature = "map_entry_recover_keys", issue = "34285")]
#[rustc_deprecated(since = "1.12.0", reason = "renamed to `remove_entry`")]
pub fn remove_pair(self) -> (K, V) {
self.remove_entry()
}

/// Take the ownership of the key and value from the map.
///
/// # Examples
///
/// ```
/// #![feature(map_entry_recover_keys)]
///
/// use std::collections::HashMap;
/// use std::collections::hash_map::Entry;
///
Expand All @@ -1655,13 +1660,13 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
///
/// if let Entry::Occupied(o) = map.entry("poneyland") {
/// // We delete the entry from the map.
/// o.remove_pair();
/// o.remove_entry();
/// }
///
/// assert_eq!(map.contains_key("poneyland"), false);
/// ```
#[unstable(feature = "map_entry_recover_keys", issue = "34285")]
pub fn remove_pair(self) -> (K, V) {
#[stable(feature = "map_entry_recover_keys2", since = "1.12.0")]
pub fn remove_entry(self) -> (K, V) {
pop_internal(self.elem)
}

Expand Down Expand Up @@ -1808,8 +1813,6 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// # Examples
///
/// ```
/// #![feature(map_entry_recover_keys)]
///
/// use std::collections::HashMap;
/// use std::collections::hash_map::Entry;
///
Expand All @@ -1819,7 +1822,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// v.into_key();
/// }
/// ```
#[unstable(feature = "map_entry_recover_keys", issue = "34285")]
#[stable(feature = "map_entry_recover_keys2", since = "1.12.0")]
pub fn into_key(self) -> K {
self.key
}
Expand Down

0 comments on commit 47b7f4d

Please sign in to comment.