From b7152901ce1d3a57ecd3468a43adc20dd82fad52 Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Fri, 15 Sep 2017 17:06:49 +0200 Subject: [PATCH] stabilized iterator_for_each (closes #42986) updated clippy and rls as it uses the iterator_for_each --- .../src/library-features/iterator-for-each.md | 17 ----------------- src/libcore/iter/iterator.rs | 6 +----- src/tools/rls | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 src/doc/unstable-book/src/library-features/iterator-for-each.md diff --git a/src/doc/unstable-book/src/library-features/iterator-for-each.md b/src/doc/unstable-book/src/library-features/iterator-for-each.md deleted file mode 100644 index ebeb5f6a1de51..0000000000000 --- a/src/doc/unstable-book/src/library-features/iterator-for-each.md +++ /dev/null @@ -1,17 +0,0 @@ -# `iterator_for_each` - -The tracking issue for this feature is: [#42986] - -[#42986]: https://github.com/rust-lang/rust/issues/42986 - ------------------------- - -To call a closure on each element of an iterator, you can use `for_each`: - -```rust -#![feature(iterator_for_each)] - -fn main() { - (0..10).for_each(|i| println!("{}", i)); -} -``` diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 7c009114afefb..edafd0ce2c227 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -498,8 +498,6 @@ pub trait Iterator { /// Basic usage: /// /// ``` - /// #![feature(iterator_for_each)] - /// /// use std::sync::mpsc::channel; /// /// let (tx, rx) = channel(); @@ -514,15 +512,13 @@ pub trait Iterator { /// might be preferable to keep a functional style with longer iterators: /// /// ``` - /// #![feature(iterator_for_each)] - /// /// (0..5).flat_map(|x| x * 100 .. x * 110) /// .enumerate() /// .filter(|&(i, x)| (i + x) % 3 == 0) /// .for_each(|(i, x)| println!("{}:{}", i, x)); /// ``` #[inline] - #[unstable(feature = "iterator_for_each", issue = "42986")] + #[stable(feature = "iterator_for_each", since = "1.22.0")] fn for_each(self, mut f: F) where Self: Sized, F: FnMut(Self::Item), { diff --git a/src/tools/rls b/src/tools/rls index 52d48656f93ee..7221e38023c41 160000 --- a/src/tools/rls +++ b/src/tools/rls @@ -1 +1 @@ -Subproject commit 52d48656f93eeeb2c568e6c1048e64168e5b209f +Subproject commit 7221e38023c41ff2532ebbf54a7da296fd488b50