Skip to content

Commit c186da7

Browse files
RangeFull for-loop iteration fails because of IntoIterator
Saying that "[for-loop iteration] fails because .. has no IntoIterator impl" is more direct than saying "...no Iterator impl" because for loops sugar into IntoIterator invocations. It just happens that the other Range* operators implement Iterator and rely on the fact that `IntoIterator` is implemented for `T: Iterator`.
1 parent 377ae44 commit c186da7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
14661466
/// assert_eq!((..), std::ops::RangeFull);
14671467
///
14681468
/// // for i in .. {
1469-
/// // println!("This errors because .. has no Iterator impl");
1469+
/// // println!("This errors because .. has no IntoIterator impl");
14701470
/// // }
14711471
///
14721472
/// let arr = [0, 1, 2, 3];

0 commit comments

Comments
 (0)