mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Rollup merge of #94893 - notriddle:notriddle/regression-test-issue-90315, r=Mark-Simulacrum
diagnostics: regression test for `<usize as Iterator>::rev` Closes #90315
This commit is contained in:
commit
ce0473ee03
7
src/test/ui/methods/issues/issue-90315.rs
Normal file
7
src/test/ui/methods/issues/issue-90315.rs
Normal file
@ -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.
|
||||
}
|
||||
}
|
13
src/test/ui/methods/issues/issue-90315.stderr
Normal file
13
src/test/ui/methods/issues/issue-90315.stderr
Normal file
@ -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`.
|
Loading…
Reference in New Issue
Block a user