rollup merge of #23648: steveklabnik/rollup

- Successful merges: #22954, #23119, #23509, #23561, #23590, #23607, #23608, #23618, #23622, #23639, #23641
- Failed merges: #23401
This commit is contained in:
Alex Crichton 2015-03-23 15:11:15 -07:00
commit 7101ff4513
3 changed files with 25 additions and 23 deletions

View file

@ -125,26 +125,26 @@ pub struct RangeMut<'a, K: 'a, V: 'a> {
} }
/// A view into a single entry in a map, which may either be vacant or occupied. /// A view into a single entry in a map, which may either be vacant or occupied.
#[unstable(feature = "collections", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still under development")]
pub enum Entry<'a, K:'a, V:'a> { pub enum Entry<'a, K:'a, V:'a> {
/// A vacant Entry /// A vacant Entry
#[stable(feature = "rust1", since = "1.0.0")]
Vacant(VacantEntry<'a, K, V>), Vacant(VacantEntry<'a, K, V>),
/// An occupied Entry /// An occupied Entry
#[stable(feature = "rust1", since = "1.0.0")]
Occupied(OccupiedEntry<'a, K, V>), Occupied(OccupiedEntry<'a, K, V>),
} }
/// A vacant Entry. /// A vacant Entry.
#[unstable(feature = "collections", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still under development")]
pub struct VacantEntry<'a, K:'a, V:'a> { pub struct VacantEntry<'a, K:'a, V:'a> {
key: K, key: K,
stack: stack::SearchStack<'a, K, V, node::handle::Edge, node::handle::Leaf>, stack: stack::SearchStack<'a, K, V, node::handle::Edge, node::handle::Leaf>,
} }
/// An occupied Entry. /// An occupied Entry.
#[unstable(feature = "collections", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still under development")]
pub struct OccupiedEntry<'a, K:'a, V:'a> { pub struct OccupiedEntry<'a, K:'a, V:'a> {
stack: stack::SearchStack<'a, K, V, node::handle::KV, node::handle::LeafOrInternal>, stack: stack::SearchStack<'a, K, V, node::handle::KV, node::handle::LeafOrInternal>,
} }
@ -1143,9 +1143,9 @@ impl<'a, K, V> DoubleEndedIterator for RangeMut<'a, K, V> {
} }
impl<'a, K: Ord, V> Entry<'a, K, V> { impl<'a, K: Ord, V> Entry<'a, K, V> {
#[unstable(feature = "collections",
reason = "matches collection reform v2 specification, waiting for dust to settle")]
/// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
#[unstable(feature = "std_misc",
reason = "will soon be replaced by or_insert")]
pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> { pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> {
match self { match self {
Occupied(entry) => Ok(entry.into_mut()), Occupied(entry) => Ok(entry.into_mut()),

View file

@ -67,26 +67,28 @@ pub struct VecMap<V> {
} }
/// A view into a single entry in a map, which may either be vacant or occupied. /// A view into a single entry in a map, which may either be vacant or occupied.
#[unstable(feature = "collections",
reason = "precise API still under development")] #[stable(feature = "rust1", since = "1.0.0")]
pub enum Entry<'a, V:'a> { pub enum Entry<'a, V:'a> {
/// A vacant Entry /// A vacant Entry
#[stable(feature = "rust1", since = "1.0.0")]
Vacant(VacantEntry<'a, V>), Vacant(VacantEntry<'a, V>),
/// An occupied Entry /// An occupied Entry
#[stable(feature = "rust1", since = "1.0.0")]
Occupied(OccupiedEntry<'a, V>), Occupied(OccupiedEntry<'a, V>),
} }
/// A vacant Entry. /// A vacant Entry.
#[unstable(feature = "collections",
reason = "precise API still under development")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct VacantEntry<'a, V:'a> { pub struct VacantEntry<'a, V:'a> {
map: &'a mut VecMap<V>, map: &'a mut VecMap<V>,
index: usize, index: usize,
} }
/// An occupied Entry. /// An occupied Entry.
#[unstable(feature = "collections", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still under development")]
pub struct OccupiedEntry<'a, V:'a> { pub struct OccupiedEntry<'a, V:'a> {
map: &'a mut VecMap<V>, map: &'a mut VecMap<V>,
index: usize, index: usize,
@ -651,7 +653,7 @@ impl<V> VecMap<V> {
impl<'a, V> Entry<'a, V> { impl<'a, V> Entry<'a, V> {
#[unstable(feature = "collections", #[unstable(feature = "collections",
reason = "matches collection reform v2 specification, waiting for dust to settle")] reason = "will soon be replaced by or_insert")]
/// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> { pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> {
match self { match self {

View file

@ -1339,15 +1339,13 @@ pub struct Drain<'a, K: 'a, V: 'a> {
} }
/// A view into a single occupied location in a HashMap. /// A view into a single occupied location in a HashMap.
#[unstable(feature = "std_misc", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still being fleshed out")]
pub struct OccupiedEntry<'a, K: 'a, V: 'a> { pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
elem: FullBucket<K, V, &'a mut RawTable<K, V>>, elem: FullBucket<K, V, &'a mut RawTable<K, V>>,
} }
/// A view into a single empty location in a HashMap. /// A view into a single empty location in a HashMap.
#[unstable(feature = "std_misc", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still being fleshed out")]
pub struct VacantEntry<'a, K: 'a, V: 'a> { pub struct VacantEntry<'a, K: 'a, V: 'a> {
hash: SafeHash, hash: SafeHash,
key: K, key: K,
@ -1355,12 +1353,14 @@ pub struct VacantEntry<'a, K: 'a, V: 'a> {
} }
/// A view into a single location in a map, which may be vacant or occupied. /// A view into a single location in a map, which may be vacant or occupied.
#[unstable(feature = "std_misc", #[stable(feature = "rust1", since = "1.0.0")]
reason = "precise API still being fleshed out")]
pub enum Entry<'a, K: 'a, V: 'a> { pub enum Entry<'a, K: 'a, V: 'a> {
/// An occupied Entry. /// An occupied Entry.
#[stable(feature = "rust1", since = "1.0.0")]
Occupied(OccupiedEntry<'a, K, V>), Occupied(OccupiedEntry<'a, K, V>),
/// A vacant Entry. /// A vacant Entry.
#[stable(feature = "rust1", since = "1.0.0")]
Vacant(VacantEntry<'a, K, V>), Vacant(VacantEntry<'a, K, V>),
} }
@ -1481,10 +1481,10 @@ impl<'a, K, V> ExactSizeIterator for Drain<'a, K, V> {
#[inline] fn len(&self) -> usize { self.inner.len() } #[inline] fn len(&self) -> usize { self.inner.len() }
} }
#[unstable(feature = "std_misc",
reason = "matches collection reform v2 specification, waiting for dust to settle")]
impl<'a, K, V> Entry<'a, K, V> { impl<'a, K, V> Entry<'a, K, V> {
/// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant. /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant.
#[unstable(feature = "std_misc",
reason = "will soon be replaced by or_insert")]
pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> { pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> {
match self { match self {
Occupied(entry) => Ok(entry.into_mut()), Occupied(entry) => Ok(entry.into_mut()),