Skip to content

Commit ef7c833

Browse files
committed
Move the doc test to edition2021
1 parent a30f963 commit ef7c833

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

library/core/src/array/iter.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,28 +173,27 @@ impl<T, const N: usize> IntoIter<T, N> {
173173
/// ```
174174
///
175175
/// `[1, 2].into_iter()` and `[].into_iter()` have different types
176-
/// ```should_fail
176+
/// ```should_fail,edition2021
177177
/// #![feature(array_into_iter_constructors)]
178178
/// use std::array::IntoIter;
179179
///
180-
/// # // FIXME: use `.into_iter()` once the doc tests are in edition2021
181180
/// pub fn get_bytes(b: bool) -> IntoIter<i8, 4> {
182181
/// if b {
183-
/// IntoIter::new([1, 2, 3, 4])
182+
/// [1, 2, 3, 4].into_iter()
184183
/// } else {
185-
/// IntoIter::new([]) // error[E0308]: mismatched types
184+
/// [].into_iter() // error[E0308]: mismatched types
186185
/// }
187186
/// }
188187
/// ```
189188
///
190189
/// But using this method you can get an empty iterator of appropriate size:
191-
/// ```
190+
/// ```edition2021
192191
/// #![feature(array_into_iter_constructors)]
193192
/// use std::array::IntoIter;
194193
///
195194
/// pub fn get_bytes(b: bool) -> IntoIter<i8, 4> {
196195
/// if b {
197-
/// IntoIter::new([1, 2, 3, 4])
196+
/// [1, 2, 3, 4].into_iter()
198197
/// } else {
199198
/// IntoIter::empty()
200199
/// }

0 commit comments

Comments
 (0)