From 5c1c50ee174f20574ddbf67b43ab0e9bb5b2c60d Mon Sep 17 00:00:00 2001 From: Ryan Sullivant Date: Tue, 10 Nov 2020 23:48:01 -0700 Subject: [PATCH] Change variable named `foo` and rerun `update-all-references` --- tests/ui/search_is_some.rs | 8 ++++---- tests/ui/search_is_some.stderr | 16 ++++------------ tests/ui/search_is_some_fixable.stderr | 12 ++++++------ 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/tests/ui/search_is_some.rs b/tests/ui/search_is_some.rs index 1399138a0d27..f0dc3b3d06bb 100644 --- a/tests/ui/search_is_some.rs +++ b/tests/ui/search_is_some.rs @@ -28,10 +28,10 @@ fn main() { ).is_some(); // Check that we don't lint if the caller is not an `Iterator` or string - let foo = IteratorFalsePositives { foo: 0 }; - let _ = foo.find().is_some(); - let _ = foo.position().is_some(); - let _ = foo.rposition().is_some(); + let falsepos = IteratorFalsePositives { foo: 0 }; + let _ = falsepos.find().is_some(); + let _ = falsepos.position().is_some(); + let _ = falsepos.rposition().is_some(); // check that we don't lint if `find()` is called with // `Pattern` that is not a string let _ = "hello world".find(|c: char| c == 'o' || c == 'l').is_some(); diff --git a/tests/ui/search_is_some.stderr b/tests/ui/search_is_some.stderr index 43827a6a98dc..c601f568c609 100644 --- a/tests/ui/search_is_some.stderr +++ b/tests/ui/search_is_some.stderr @@ -1,4 +1,4 @@ -error: called `is_some()` after searching an `Iterator` with find +error: called `is_some()` after searching an `Iterator` with `find` --> $DIR/search_is_some.rs:13:13 | LL | let _ = v.iter().find(|&x| { @@ -11,7 +11,7 @@ LL | | ).is_some(); = note: `-D clippy::search-is-some` implied by `-D warnings` = help: this is more succinctly expressed by calling `any()` -error: called `is_some()` after searching an `Iterator` with position +error: called `is_some()` after searching an `Iterator` with `position` --> $DIR/search_is_some.rs:19:13 | LL | let _ = v.iter().position(|&x| { @@ -23,7 +23,7 @@ LL | | ).is_some(); | = help: this is more succinctly expressed by calling `any()` -error: called `is_some()` after searching an `Iterator` with rposition +error: called `is_some()` after searching an `Iterator` with `rposition` --> $DIR/search_is_some.rs:25:13 | LL | let _ = v.iter().rposition(|&x| { @@ -35,13 +35,5 @@ LL | | ).is_some(); | = help: this is more succinctly expressed by calling `any()` -error: use of a blacklisted/placeholder name `foo` - --> $DIR/search_is_some.rs:31:9 - | -LL | let foo = IteratorFalsePositives { foo: 0 }; - | ^^^ - | - = note: `-D clippy::blacklisted-name` implied by `-D warnings` - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors diff --git a/tests/ui/search_is_some_fixable.stderr b/tests/ui/search_is_some_fixable.stderr index f4c5d7a3389f..23c1d9a901b9 100644 --- a/tests/ui/search_is_some_fixable.stderr +++ b/tests/ui/search_is_some_fixable.stderr @@ -1,4 +1,4 @@ -error: called `is_some()` after searching an `Iterator` with find +error: called `is_some()` after searching an `Iterator` with `find` --> $DIR/search_is_some_fixable.rs:10:22 | LL | let _ = v.iter().find(|&x| *x < 0).is_some(); @@ -6,31 +6,31 @@ LL | let _ = v.iter().find(|&x| *x < 0).is_some(); | = note: `-D clippy::search-is-some` implied by `-D warnings` -error: called `is_some()` after searching an `Iterator` with find +error: called `is_some()` after searching an `Iterator` with `find` --> $DIR/search_is_some_fixable.rs:11:20 | LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| **y == x)` -error: called `is_some()` after searching an `Iterator` with find +error: called `is_some()` after searching an `Iterator` with `find` --> $DIR/search_is_some_fixable.rs:12:20 | LL | let _ = (0..1).find(|x| *x == 0).is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 0)` -error: called `is_some()` after searching an `Iterator` with find +error: called `is_some()` after searching an `Iterator` with `find` --> $DIR/search_is_some_fixable.rs:13:22 | LL | let _ = v.iter().find(|x| **x == 0).is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x == 0)` -error: called `is_some()` after searching an `Iterator` with position +error: called `is_some()` after searching an `Iterator` with `position` --> $DIR/search_is_some_fixable.rs:16:22 | LL | let _ = v.iter().position(|&x| x < 0).is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)` -error: called `is_some()` after searching an `Iterator` with rposition +error: called `is_some()` after searching an `Iterator` with `rposition` --> $DIR/search_is_some_fixable.rs:19:22 | LL | let _ = v.iter().rposition(|&x| x < 0).is_some();