about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Neumann <mail@timnn.me>2017-09-17 13:19:08 +0200
committerGitHub <noreply@github.com>2017-09-17 13:19:08 +0200
commit1437e53f9f5b9d66bc71f9626291a7fc231f0239 (patch)
treea94494f28f65bb787cce0b4e53eb812a6014089d
parent4dc01c475f01a47b1b1d5d548e86b16f821f0ec8 (diff)
parentb7152901ce1d3a57ecd3468a43adc20dd82fad52 (diff)
downloadrust-1437e53f9f5b9d66bc71f9626291a7fc231f0239.tar.gz
rust-1437e53f9f5b9d66bc71f9626291a7fc231f0239.zip
Rollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton
stabilized iterator_for_each (closes #42986)

Also updated clippy and rls as these use the iterator_for_each

I've made my first PR's today so most likely I've done something wrong. Sorry about that!
-rw-r--r--src/doc/unstable-book/src/library-features/iterator-for-each.md17
-rw-r--r--src/libcore/iter/iterator.rs6
m---------src/tools/rls0
3 files changed, 1 insertions, 22 deletions
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 ebeb5f6a1de..00000000000
--- 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 7c009114afe..edafd0ce2c2 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<F>(self, mut f: F) where
         Self: Sized, F: FnMut(Self::Item),
     {
diff --git a/src/tools/rls b/src/tools/rls
-Subproject 52d48656f93eeeb2c568e6c1048e64168e5b209
+Subproject 7221e38023c41ff2532ebbf54a7da296fd488b5