]> git.lizzy.rs Git - rust.git/commitdiff
add iter_any test
authorDavid Renshaw <dwrenshaw@gmail.com>
Sat, 6 Jan 2018 21:50:21 +0000 (16:50 -0500)
committerOliver Schneider <oli-obk@users.noreply.github.com>
Fri, 11 May 2018 11:51:04 +0000 (13:51 +0200)
tests/run-pass/iter_any.rs [new file with mode: 0644]

diff --git a/tests/run-pass/iter_any.rs b/tests/run-pass/iter_any.rs
new file mode 100644 (file)
index 0000000..b14eb07
--- /dev/null
@@ -0,0 +1,12 @@
+pub fn main() {
+    let f = |x: &u8| { 10u8 == *x };
+    f(&1u8);
+
+    let g = |(), x: &u8| { 10u8 == *x };
+    g((), &1u8);
+
+    let h = |(), (), x: &u8| { 10u8 == *x };
+    h((), (), &1u8);
+
+    [1, 2, 3u8].into_iter().any(|elt| 10 == *elt);
+}