]> git.lizzy.rs Git - rust.git/blob - tests/ui/eta.stderr
Auto merge of #8359 - flip1995:rustup, r=flip1995
[rust.git] / tests / ui / eta.stderr
1 error: redundant closure
2   --> $DIR/eta.rs:28:27
3    |
4 LL |     let a = Some(1u8).map(|a| foo(a));
5    |                           ^^^^^^^^^^ help: replace the closure with the function itself: `foo`
6    |
7    = note: `-D clippy::redundant-closure` implied by `-D warnings`
8
9 error: redundant closure
10   --> $DIR/eta.rs:32:40
11    |
12 LL |     let _: Option<Vec<u8>> = true.then(|| vec![]); // special case vec!
13    |                                        ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::Vec::new`
14
15 error: redundant closure
16   --> $DIR/eta.rs:33:35
17    |
18 LL |     let d = Some(1u8).map(|a| foo((|b| foo2(b))(a))); //is adjusted?
19    |                                   ^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo2`
20
21 error: redundant closure
22   --> $DIR/eta.rs:34:26
23    |
24 LL |     all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
25    |                          ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `below`
26
27 error: redundant closure
28   --> $DIR/eta.rs:40:27
29    |
30 LL |     let e = Some(1u8).map(|a| divergent(a));
31    |                           ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `divergent`
32
33 error: redundant closure
34   --> $DIR/eta.rs:41:27
35    |
36 LL |     let e = Some(1u8).map(|a| generic(a));
37    |                           ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `generic`
38
39 error: redundant closure
40   --> $DIR/eta.rs:87:51
41    |
42 LL |     let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
43    |                                                   ^^^^^^^^^^^ help: replace the closure with the method itself: `TestStruct::foo`
44    |
45    = note: `-D clippy::redundant-closure-for-method-calls` implied by `-D warnings`
46
47 error: redundant closure
48   --> $DIR/eta.rs:88:51
49    |
50 LL |     let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo());
51    |                                                   ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `TestTrait::trait_foo`
52
53 error: redundant closure
54   --> $DIR/eta.rs:90:42
55    |
56 LL |     let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear());
57    |                                          ^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::clear`
58
59 error: redundant closure
60   --> $DIR/eta.rs:94:29
61    |
62 LL |     let e = Some("str").map(|s| s.to_string());
63    |                             ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
64
65 error: redundant closure
66   --> $DIR/eta.rs:95:27
67    |
68 LL |     let e = Some('a').map(|s| s.to_uppercase());
69    |                           ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_uppercase`
70
71 error: redundant closure
72   --> $DIR/eta.rs:97:65
73    |
74 LL |     let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
75    |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_ascii_uppercase`
76
77 error: redundant closure
78   --> $DIR/eta.rs:160:22
79    |
80 LL |     requires_fn_once(|| x());
81    |                      ^^^^^^ help: replace the closure with the function itself: `x`
82
83 error: redundant closure
84   --> $DIR/eta.rs:167:27
85    |
86 LL |     let a = Some(1u8).map(|a| foo_ptr(a));
87    |                           ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo_ptr`
88
89 error: redundant closure
90   --> $DIR/eta.rs:172:27
91    |
92 LL |     let a = Some(1u8).map(|a| closure(a));
93    |                           ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `closure`
94
95 error: redundant closure
96   --> $DIR/eta.rs:204:28
97    |
98 LL |     x.into_iter().for_each(|x| add_to_res(x));
99    |                            ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
100
101 error: redundant closure
102   --> $DIR/eta.rs:205:28
103    |
104 LL |     y.into_iter().for_each(|x| add_to_res(x));
105    |                            ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
106
107 error: redundant closure
108   --> $DIR/eta.rs:206:28
109    |
110 LL |     z.into_iter().for_each(|x| add_to_res(x));
111    |                            ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `add_to_res`
112
113 error: redundant closure
114   --> $DIR/eta.rs:213:21
115    |
116 LL |         Some(1).map(|n| closure(n));
117    |                     ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut closure`
118
119 error: redundant closure
120   --> $DIR/eta.rs:232:21
121    |
122 LL |     map_str_to_path(|s| s.as_ref());
123    |                     ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::convert::AsRef::as_ref`
124
125 error: aborting due to 20 previous errors
126