Skip to content

Commit ce0473e

Browse files
authored
Rollup merge of #94893 - notriddle:notriddle/regression-test-issue-90315, r=Mark-Simulacrum
diagnostics: regression test for `<usize as Iterator>::rev` Closes #90315
2 parents d8e59ed + 40c9bc0 commit ce0473e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
let arr = &[0,1,2,3];
3+
for _i in 0..arr.len().rev() { //~ERROR not an iterator
4+
// The above error used to say “the method `rev` exists for type `usize`”.
5+
// This regression test ensures it doesn't say that any more.
6+
}
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0599]: `usize` is not an iterator
2+
--> $DIR/issue-90315.rs:3:26
3+
|
4+
LL | for _i in 0..arr.len().rev() {
5+
| ^^^ `usize` is not an iterator
6+
|
7+
= note: the following trait bounds were not satisfied:
8+
`usize: Iterator`
9+
which is required by `&mut usize: Iterator`
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0599`.

0 commit comments

Comments
 (0)