Skip to content

Commit 02a8d5b

Browse files
committed
std: Deprecate the RandomAccessIterator trait
This trait has not proven itself over time as being core and fundamentally useful to iterators, so it's being deprecated to allow time to iterate on it out of tree.
1 parent ce1a965 commit 02a8d5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcore/iter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,10 @@ impl<'a, I: DoubleEndedIterator + ?Sized> DoubleEndedIterator for &'a mut I {
12301230
#[unstable(feature = "iter_idx",
12311231
reason = "not widely used, may be better decomposed into Index \
12321232
and ExactSizeIterator")]
1233+
#[deprecated(since = "1.2.0",
1234+
reason = "trait has not proven itself as a widely useful \
1235+
abstraction for iterators, and more time may be needed \
1236+
for iteration on the design")]
12331237
pub trait RandomAccessIterator: Iterator {
12341238
/// Returns the number of indexable elements. At most `std::usize::MAX`
12351239
/// elements are indexable, even if the iterator represents a longer range.

0 commit comments

Comments
 (0)