Skip to content

Commit

Permalink
Auto merge of #51079 - GuillaumeGomez:stabilize-entry-or-default, r=S…
Browse files Browse the repository at this point in the history
…imonSapin

Stabilize entry-or-default

Fixes #44324.

cc @SimonSapin
  • Loading branch information
bors committed Jun 10, 2018
2 parents 684b8d3 + 861c7cb commit 900037e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
13 changes: 0 additions & 13 deletions src/doc/unstable-book/src/library-features/entry-or-default.md

This file was deleted.

3 changes: 1 addition & 2 deletions src/liballoc/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2184,14 +2184,13 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
}

impl<'a, K: Ord, V: Default> Entry<'a, K, V> {
#[unstable(feature = "entry_or_default", issue = "44324")]
#[stable(feature = "entry_or_default", since = "1.28.0")]
/// Ensures a value is in the entry by inserting the default value if empty,
/// and returns a mutable reference to the value in the entry.
///
/// # Examples
///
/// ```
/// #![feature(entry_or_default)]
/// # fn main() {
/// use std::collections::BTreeMap;
///
Expand Down
1 change: 0 additions & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
#![feature(entry_or_default)]
#![feature(from_ref)]
#![feature(fs_read_write)]
#![feature(iterator_find_map)]
Expand Down
4 changes: 1 addition & 3 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2161,14 +2161,13 @@ impl<'a, K, V> Entry<'a, K, V> {
}

impl<'a, K, V: Default> Entry<'a, K, V> {
#[unstable(feature = "entry_or_default", issue = "44324")]
#[stable(feature = "entry_or_default", since = "1.28.0")]
/// Ensures a value is in the entry by inserting the default value if empty,
/// and returns a mutable reference to the value in the entry.
///
/// # Examples
///
/// ```
/// #![feature(entry_or_default)]
/// # fn main() {
/// use std::collections::HashMap;
///
Expand All @@ -2184,7 +2183,6 @@ impl<'a, K, V: Default> Entry<'a, K, V> {
Vacant(entry) => entry.insert(Default::default()),
}
}

}

impl<'a, K, V> OccupiedEntry<'a, K, V> {
Expand Down

0 comments on commit 900037e

Please sign in to comment.