Skip to content

Commit a7220d9

Browse files
committed
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.
1 parent 31e9ed5 commit a7220d9

File tree

9 files changed

+234
-770
lines changed

9 files changed

+234
-770
lines changed

src/libcore/iter/mod.rs

-33
Original file line numberDiff line numberDiff line change
@@ -1244,39 +1244,6 @@ impl<I: Iterator> Peekable<I> {
12441244
None => None,
12451245
}
12461246
}
1247-
1248-
/// Checks if the iterator has finished iterating.
1249-
///
1250-
/// Returns `true` if there are no more elements in the iterator, and
1251-
/// `false` if there are.
1252-
///
1253-
/// # Examples
1254-
///
1255-
/// Basic usage:
1256-
///
1257-
/// ```
1258-
/// #![feature(peekable_is_empty)]
1259-
///
1260-
/// let xs = [1, 2, 3];
1261-
///
1262-
/// let mut iter = xs.iter().peekable();
1263-
///
1264-
/// // There are still elements to iterate over
1265-
/// assert_eq!(iter.is_empty(), false);
1266-
///
1267-
/// // Let's consume the iterator
1268-
/// iter.next();
1269-
/// iter.next();
1270-
/// iter.next();
1271-
///
1272-
/// assert_eq!(iter.is_empty(), true);
1273-
/// ```
1274-
#[unstable(feature = "peekable_is_empty", issue = "32111")]
1275-
#[inline]
1276-
#[rustc_deprecated(since = "1.10.0", reason = "replaced by .peek().is_none()")]
1277-
pub fn is_empty(&mut self) -> bool {
1278-
self.peek().is_none()
1279-
}
12801247
}
12811248

12821249
/// An iterator that rejects elements while `predicate` is true.

0 commit comments

Comments
 (0)