-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #94893 - notriddle:notriddle/regression-test-issue-90…
…315, r=Mark-Simulacrum diagnostics: regression test for `<usize as Iterator>::rev` Closes #90315
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fn main() { | ||
let arr = &[0,1,2,3]; | ||
for _i in 0..arr.len().rev() { //~ERROR not an iterator | ||
// The above error used to say “the method `rev` exists for type `usize`”. | ||
// This regression test ensures it doesn't say that any more. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0599]: `usize` is not an iterator | ||
--> $DIR/issue-90315.rs:3:26 | ||
| | ||
LL | for _i in 0..arr.len().rev() { | ||
| ^^^ `usize` is not an iterator | ||
| | ||
= note: the following trait bounds were not satisfied: | ||
`usize: Iterator` | ||
which is required by `&mut usize: Iterator` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0599`. |