From 0c35c699d43ba24943bb8f38986f84c4be676dc3 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 30 May 2019 18:00:17 +0000 Subject: [PATCH] Stabilize iter_nth_back feature --- src/liballoc/lib.rs | 1 - src/libcore/iter/traits/double_ended.rs | 5 +---- src/libcore/tests/lib.rs | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index d90036eaf49b8..bfc008e14a486 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -112,7 +112,6 @@ #![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)] #![feature(alloc_layout_extra)] #![feature(try_trait)] -#![feature(iter_nth_back)] // Allow testing this library diff --git a/src/libcore/iter/traits/double_ended.rs b/src/libcore/iter/traits/double_ended.rs index 06de95c082724..2c1aeb5690a58 100644 --- a/src/libcore/iter/traits/double_ended.rs +++ b/src/libcore/iter/traits/double_ended.rs @@ -88,7 +88,6 @@ pub trait DoubleEndedIterator: Iterator { /// Basic usage: /// /// ``` - /// #![feature(iter_nth_back)] /// let a = [1, 2, 3]; /// assert_eq!(a.iter().nth_back(2), Some(&1)); /// ``` @@ -96,7 +95,6 @@ pub trait DoubleEndedIterator: Iterator { /// Calling `nth_back()` multiple times doesn't rewind the iterator: /// /// ``` - /// #![feature(iter_nth_back)] /// let a = [1, 2, 3]; /// /// let mut iter = a.iter(); @@ -108,12 +106,11 @@ pub trait DoubleEndedIterator: Iterator { /// Returning `None` if there are less than `n + 1` elements: /// /// ``` - /// #![feature(iter_nth_back)] /// let a = [1, 2, 3]; /// assert_eq!(a.iter().nth_back(10), None); /// ``` #[inline] - #[unstable(feature = "iter_nth_back", issue = "56995")] + #[stable(feature = "iter_nth_back", since = "1.37.0")] fn nth_back(&mut self, mut n: usize) -> Option { for x in self.rev() { if n == 0 { return Some(x) } diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index c617596aba801..0dba2bed62c93 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -10,7 +10,6 @@ #![feature(fmt_internals)] #![feature(hashmap_internals)] #![feature(is_sorted)] -#![feature(iter_nth_back)] #![feature(iter_once_with)] #![feature(pattern)] #![feature(range_is_empty)]