Skip to content

Commit

Permalink
Auto merge of #34705 - alexcrichton:clean-deprecated, r=brson
Browse files Browse the repository at this point in the history
std: Clean out deprecated APIs

This primarily removes a lot of `sync::Static*` APIs and rejiggers the
associated implementations. While doing this it was discovered that the
`is_poisoned` method can actually result in a data race for the Mutex/RwLock
primitives, so the inner `Cell<bool>` was changed to an `AtomicBool` to prevent
the associated data race. Otherwise the usage/gurantees should be the same
they were before.
  • Loading branch information
bors authored Jul 12, 2016
2 parents 3085ec7 + a7220d9 commit 26fd011
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 770 deletions.
33 changes: 0 additions & 33 deletions src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,39 +1244,6 @@ impl<I: Iterator> Peekable<I> {
None => None,
}
}

/// Checks if the iterator has finished iterating.
///
/// Returns `true` if there are no more elements in the iterator, and
/// `false` if there are.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// #![feature(peekable_is_empty)]
///
/// let xs = [1, 2, 3];
///
/// let mut iter = xs.iter().peekable();
///
/// // There are still elements to iterate over
/// assert_eq!(iter.is_empty(), false);
///
/// // Let's consume the iterator
/// iter.next();
/// iter.next();
/// iter.next();
///
/// assert_eq!(iter.is_empty(), true);
/// ```
#[unstable(feature = "peekable_is_empty", issue = "32111")]
#[inline]
#[rustc_deprecated(since = "1.10.0", reason = "replaced by .peek().is_none()")]
pub fn is_empty(&mut self) -> bool {
self.peek().is_none()
}
}

/// An iterator that rejects elements while `predicate` is true.
Expand Down
Loading

0 comments on commit 26fd011

Please sign in to comment.