about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-03-12 22:56:01 +0100
committerGitHub <noreply@github.com>2022-03-12 22:56:01 +0100
commit6cfb44486caf0b21ce9d7e4b4f2f45e5bcb1bd92 (patch)
tree7a2aadb874e0b5ae94c5f0e43d6c945f4ca39269
parentf103b2969b0088953873dc1ac92eb3387c753596 (diff)
parentce6f987bdb6674a93260868478fc1bc95868c580 (diff)
downloadrust-6cfb44486caf0b21ce9d7e4b4f2f45e5bcb1bd92.tar.gz
rust-6cfb44486caf0b21ce9d7e4b4f2f45e5bcb1bd92.zip
Rollup merge of #94867 - notriddle:notriddle/i32-count-regression-test, r=Dylan-DPC
Add regression test for `<i32 as Iterator>::count`

Closes #84495
-rw-r--r--src/test/ui/methods/issues/issue-84495.rs4
-rw-r--r--src/test/ui/methods/issues/issue-84495.stderr13
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/methods/issues/issue-84495.rs b/src/test/ui/methods/issues/issue-84495.rs
new file mode 100644
index 00000000000..28c094bf2ac
--- /dev/null
+++ b/src/test/ui/methods/issues/issue-84495.rs
@@ -0,0 +1,4 @@
+fn main() {
+    let x: i32 = 1;
+    println!("{:?}", x.count()); //~ ERROR is not an iterator
+}
diff --git a/src/test/ui/methods/issues/issue-84495.stderr b/src/test/ui/methods/issues/issue-84495.stderr
new file mode 100644
index 00000000000..b0217a7c844
--- /dev/null
+++ b/src/test/ui/methods/issues/issue-84495.stderr
@@ -0,0 +1,13 @@
+error[E0599]: `i32` is not an iterator
+  --> $DIR/issue-84495.rs:3:24
+   |
+LL |     println!("{:?}", x.count());
+   |                        ^^^^^ `i32` is not an iterator
+   |
+   = note: the following trait bounds were not satisfied:
+           `i32: Iterator`
+           which is required by `&mut i32: Iterator`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.