about summary refs log tree commit diff
path: root/tests/ui/methods_fixable.fixed
diff options
context:
space:
mode:
authorEduardo Broto <ebroto@tutanota.com>2020-10-31 09:33:40 +0100
committerEduardo Broto <ebroto@tutanota.com>2020-10-31 09:33:40 +0100
commit9d73371663ec67558700b43a55d606caa71a7f71 (patch)
treebe08801aa67ac6c18a669003823d285e0933ad83 /tests/ui/methods_fixable.fixed
parent1c8c3d14ef6f9ab297103c526ba4b6023822aa87 (diff)
parent084b203988e04bcf89d3b2d6bbc77b65ecfab553 (diff)
downloadrust-9d73371663ec67558700b43a55d606caa71a7f71.tar.gz
rust-9d73371663ec67558700b43a55d606caa71a7f71.zip
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/methods_fixable.fixed')
-rw-r--r--tests/ui/methods_fixable.fixed11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/methods_fixable.fixed b/tests/ui/methods_fixable.fixed
new file mode 100644
index 00000000000..ee7c1b0da6d
--- /dev/null
+++ b/tests/ui/methods_fixable.fixed
@@ -0,0 +1,11 @@
+// run-rustfix
+
+#![warn(clippy::filter_next)]
+
+/// Checks implementation of `FILTER_NEXT` lint.
+fn main() {
+    let v = vec![3, 2, 1, 0, -1, -2, -3];
+
+    // Single-line case.
+    let _ = v.iter().find(|&x| *x < 0);
+}