about summary refs log tree commit diff
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2021-11-28 19:53:32 -0800
committerScott McMurray <scottmcm@users.noreply.github.com>2021-12-06 00:58:40 -0800
commitef7c833c203e3de3785f8cbea3006da6237f730e (patch)
tree142ee8aa637fec9959d5c98eddbc94d415e38717
parenta30f96311aa2c0c1614132b1d5dd07bcfa9267fe (diff)
downloadrust-ef7c833c203e3de3785f8cbea3006da6237f730e.tar.gz
rust-ef7c833c203e3de3785f8cbea3006da6237f730e.zip
Move the doc test to edition2021
-rw-r--r--library/core/src/array/iter.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index bebf9aa28fa..9d4cb9284a5 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -173,28 +173,27 @@ impl<T, const N: usize> IntoIter<T, N> {
     /// ```
     ///
     /// `[1, 2].into_iter()` and `[].into_iter()` have different types
-    /// ```should_fail
+    /// ```should_fail,edition2021
     /// #![feature(array_into_iter_constructors)]
     /// use std::array::IntoIter;
     ///
-    /// # // FIXME: use `.into_iter()` once the doc tests are in edition2021
     /// pub fn get_bytes(b: bool) -> IntoIter<i8, 4> {
     ///     if b {
-    ///         IntoIter::new([1, 2, 3, 4])
+    ///         [1, 2, 3, 4].into_iter()
     ///     } else {
-    ///         IntoIter::new([]) // error[E0308]: mismatched types
+    ///         [].into_iter() // error[E0308]: mismatched types
     ///     }
     /// }
     /// ```
     ///
     /// But using this method you can get an empty iterator of appropriate size:
-    /// ```
+    /// ```edition2021
     /// #![feature(array_into_iter_constructors)]
     /// use std::array::IntoIter;
     ///
     /// pub fn get_bytes(b: bool) -> IntoIter<i8, 4> {
     ///     if b {
-    ///         IntoIter::new([1, 2, 3, 4])
+    ///         [1, 2, 3, 4].into_iter()
     ///     } else {
     ///         IntoIter::empty()
     ///     }