Open
Description
After #54946, the code let x = [0..10]; for _ in x {}
will cause the following output:
error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator
--> $DIR/array-of-ranges.rs:11:14
|
LL | for _ in array_of_range {}
| ^^^^^^^^^^^^^^ if you meant to iterate between two values, remove the square brackets
|
= help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 1]`
= note: `[start..end]` is an array of one `Range`; you might have meant to have a `Range` without the brackets: `start..end`
= note: required by `std::iter::IntoIterator::into_iter`
Add a way to identify this case to rustc_on_unimplemented
, in order to avoid giving this misleading/incorrect diagnostic.