Skip to content

Commit 5c1c50e

Browse files
committed
Change variable named foo and rerun update-all-references
1 parent 56d252c commit 5c1c50e

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

tests/ui/search_is_some.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ fn main() {
2828
).is_some();
2929

3030
// Check that we don't lint if the caller is not an `Iterator` or string
31-
let foo = IteratorFalsePositives { foo: 0 };
32-
let _ = foo.find().is_some();
33-
let _ = foo.position().is_some();
34-
let _ = foo.rposition().is_some();
31+
let falsepos = IteratorFalsePositives { foo: 0 };
32+
let _ = falsepos.find().is_some();
33+
let _ = falsepos.position().is_some();
34+
let _ = falsepos.rposition().is_some();
3535
// check that we don't lint if `find()` is called with
3636
// `Pattern` that is not a string
3737
let _ = "hello world".find(|c: char| c == 'o' || c == 'l').is_some();

tests/ui/search_is_some.stderr

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: called `is_some()` after searching an `Iterator` with find
1+
error: called `is_some()` after searching an `Iterator` with `find`
22
--> $DIR/search_is_some.rs:13:13
33
|
44
LL | let _ = v.iter().find(|&x| {
@@ -11,7 +11,7 @@ LL | | ).is_some();
1111
= note: `-D clippy::search-is-some` implied by `-D warnings`
1212
= help: this is more succinctly expressed by calling `any()`
1313

14-
error: called `is_some()` after searching an `Iterator` with position
14+
error: called `is_some()` after searching an `Iterator` with `position`
1515
--> $DIR/search_is_some.rs:19:13
1616
|
1717
LL | let _ = v.iter().position(|&x| {
@@ -23,7 +23,7 @@ LL | | ).is_some();
2323
|
2424
= help: this is more succinctly expressed by calling `any()`
2525

26-
error: called `is_some()` after searching an `Iterator` with rposition
26+
error: called `is_some()` after searching an `Iterator` with `rposition`
2727
--> $DIR/search_is_some.rs:25:13
2828
|
2929
LL | let _ = v.iter().rposition(|&x| {
@@ -35,13 +35,5 @@ LL | | ).is_some();
3535
|
3636
= help: this is more succinctly expressed by calling `any()`
3737

38-
error: use of a blacklisted/placeholder name `foo`
39-
--> $DIR/search_is_some.rs:31:9
40-
|
41-
LL | let foo = IteratorFalsePositives { foo: 0 };
42-
| ^^^
43-
|
44-
= note: `-D clippy::blacklisted-name` implied by `-D warnings`
45-
46-
error: aborting due to 4 previous errors
38+
error: aborting due to 3 previous errors
4739

tests/ui/search_is_some_fixable.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
error: called `is_some()` after searching an `Iterator` with find
1+
error: called `is_some()` after searching an `Iterator` with `find`
22
--> $DIR/search_is_some_fixable.rs:10:22
33
|
44
LL | let _ = v.iter().find(|&x| *x < 0).is_some();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x < 0)`
66
|
77
= note: `-D clippy::search-is-some` implied by `-D warnings`
88

9-
error: called `is_some()` after searching an `Iterator` with find
9+
error: called `is_some()` after searching an `Iterator` with `find`
1010
--> $DIR/search_is_some_fixable.rs:11:20
1111
|
1212
LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| **y == x)`
1414

15-
error: called `is_some()` after searching an `Iterator` with find
15+
error: called `is_some()` after searching an `Iterator` with `find`
1616
--> $DIR/search_is_some_fixable.rs:12:20
1717
|
1818
LL | let _ = (0..1).find(|x| *x == 0).is_some();
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 0)`
2020

21-
error: called `is_some()` after searching an `Iterator` with find
21+
error: called `is_some()` after searching an `Iterator` with `find`
2222
--> $DIR/search_is_some_fixable.rs:13:22
2323
|
2424
LL | let _ = v.iter().find(|x| **x == 0).is_some();
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x == 0)`
2626

27-
error: called `is_some()` after searching an `Iterator` with position
27+
error: called `is_some()` after searching an `Iterator` with `position`
2828
--> $DIR/search_is_some_fixable.rs:16:22
2929
|
3030
LL | let _ = v.iter().position(|&x| x < 0).is_some();
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)`
3232

33-
error: called `is_some()` after searching an `Iterator` with rposition
33+
error: called `is_some()` after searching an `Iterator` with `rposition`
3434
--> $DIR/search_is_some_fixable.rs:19:22
3535
|
3636
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();

0 commit comments

Comments
 (0)