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`.
This commit is contained in:
parent
377ae44cf2
commit
c186da706d
1 changed files with 1 additions and 1 deletions
|
|
@ -1466,7 +1466,7 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
|
|||
/// assert_eq!((..), std::ops::RangeFull);
|
||||
///
|
||||
/// // for i in .. {
|
||||
/// // println!("This errors because .. has no Iterator impl");
|
||||
/// // println!("This errors because .. has no IntoIterator impl");
|
||||
/// // }
|
||||
///
|
||||
/// let arr = [0, 1, 2, 3];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue