about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/methods/issues/issue-90315.rs7
-rw-r--r--src/test/ui/methods/issues/issue-90315.stderr13
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/methods/issues/issue-90315.rs b/src/test/ui/methods/issues/issue-90315.rs
new file mode 100644
index 00000000000..01bf9f48402
--- /dev/null
+++ b/src/test/ui/methods/issues/issue-90315.rs
@@ -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.
+  }
+}
diff --git a/src/test/ui/methods/issues/issue-90315.stderr b/src/test/ui/methods/issues/issue-90315.stderr
new file mode 100644
index 00000000000..c6a76c9e790
--- /dev/null
+++ b/src/test/ui/methods/issues/issue-90315.stderr
@@ -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`.