Skip to content

Commit

Permalink
std: Clean out deprecated APIs
Browse files Browse the repository at this point in the history
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
alexcrichton committed Jul 12, 2016
1 parent 31e9ed5 commit a7220d9
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
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

0 comments on commit a7220d9

Please sign in to comment.