You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Range<T>; 1] is usually a mistake and often the source of type errors where Range<T> was meant, since you get it with [a..b], which is tempting from the syntax.
In theory &[0..10]could be correct in a for loop...
When using this program:
fnmain(){for r in[0..10]{println!("{:?}", r);}}
the current error message appears to be
error: the trait `core::iter::Iterator` is not implemented for the type `[core::ops::Range<_>; 1]
note: `[core::ops::Range<_>; 1]` is not an iterator; maybe try calling `.iter()` or a similar method
Surely that is understandable ("Why is the iterator in a length-1 array? Oh, better remove the []").
What bothers me more is that both messages show up three times, and count as 3 errors...
Activity
Thiez commentedon Mar 7, 2015
In theory
&[0..10]
could be correct in a for loop...When using this program:
the current error message appears to be
Surely that is understandable ("Why is the iterator in a length-1 array? Oh, better remove the
[]
").What bothers me more is that both messages show up three times, and count as 3 errors...
steveklabnik commentedon Jun 6, 2016
Triage: Same error, but only one time. It could be a bit better, probably.
clarfonthey commentedon Dec 18, 2017
Shouldn't this be a clippy issue?
Reword `rustc_on_unimplemented` errors for `Iterator`
rustc_on_unimplemented
and rewordIterator
E0277 errors #54946