File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
src/test/ui/methods/issues Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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`.
You can’t perform that action at this time.
0 commit comments