]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods.stderr
Merge remote-tracking branch 'upstream/master' into sync-from-rust
[rust.git] / tests / ui / methods.stderr
1 error: methods called `new` usually return `Self`
2   --> $DIR/methods.rs:105:5
3    |
4 LL | /     fn new() -> i32 {
5 LL | |         0
6 LL | |     }
7    | |_____^
8    |
9    = note: `-D clippy::new-ret-no-self` implied by `-D warnings`
10
11 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
12   --> $DIR/methods.rs:126:13
13    |
14 LL |     let _ = v.iter().filter(|&x| *x < 0).next();
15    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    |
17    = note: `-D clippy::filter-next` implied by `-D warnings`
18    = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
19
20 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
21   --> $DIR/methods.rs:129:13
22    |
23 LL |       let _ = v.iter().filter(|&x| {
24    |  _____________^
25 LL | |                                 *x < 0
26 LL | |                             }
27 LL | |                    ).next();
28    | |___________________________^
29
30 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
31   --> $DIR/methods.rs:146:22
32    |
33 LL |     let _ = v.iter().find(|&x| *x < 0).is_some();
34    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)`
35    |
36    = note: `-D clippy::search-is-some` implied by `-D warnings`
37
38 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
39   --> $DIR/methods.rs:147:20
40    |
41 LL |     let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
42    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)`
43
44 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
45   --> $DIR/methods.rs:148:20
46    |
47 LL |     let _ = (0..1).find(|x| *x == 0).is_some();
48    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)`
49
50 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
51   --> $DIR/methods.rs:149:22
52    |
53 LL |     let _ = v.iter().find(|x| **x == 0).is_some();
54    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)`
55
56 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
57   --> $DIR/methods.rs:152:13
58    |
59 LL |       let _ = v.iter().find(|&x| {
60    |  _____________^
61 LL | |                               *x < 0
62 LL | |                           }
63 LL | |                    ).is_some();
64    | |______________________________^
65
66 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
67   --> $DIR/methods.rs:158:22
68    |
69 LL |     let _ = v.iter().position(|&x| x < 0).is_some();
70    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
71
72 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
73   --> $DIR/methods.rs:161:13
74    |
75 LL |       let _ = v.iter().position(|&x| {
76    |  _____________^
77 LL | |                                   x < 0
78 LL | |                               }
79 LL | |                    ).is_some();
80    | |______________________________^
81
82 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
83   --> $DIR/methods.rs:167:22
84    |
85 LL |     let _ = v.iter().rposition(|&x| x < 0).is_some();
86    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
87
88 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
89   --> $DIR/methods.rs:170:13
90    |
91 LL |       let _ = v.iter().rposition(|&x| {
92    |  _____________^
93 LL | |                                    x < 0
94 LL | |                                }
95 LL | |                    ).is_some();
96    | |______________________________^
97
98 error: aborting due to 12 previous errors
99