11error: unneeded unit return type
2- --> $DIR/unused_unit.rs:18:29
2+ --> $DIR/unused_unit.rs:18:28
33 |
44LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
5- | ^^^^^ help: remove the `-> ()`
5+ | ^ ^^^^^ help: remove the `-> ()`
66 |
77note: the lint level is defined here
88 --> $DIR/unused_unit.rs:12:9
@@ -11,28 +11,28 @@ LL | #![deny(clippy::unused_unit)]
1111 | ^^^^^^^^^^^^^^^^^^^
1212
1313error: unneeded unit return type
14- --> $DIR/unused_unit.rs:19:19
14+ --> $DIR/unused_unit.rs:19:18
1515 |
1616LL | where G: Fn() -> () {
17- | ^^^^^ help: remove the `-> ()`
17+ | ^ ^^^^^ help: remove the `-> ()`
1818
1919error: unneeded unit return type
20- --> $DIR/unused_unit.rs:18:59
20+ --> $DIR/unused_unit.rs:18:58
2121 |
2222LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
23- | ^^^^^ help: remove the `-> ()`
23+ | ^ ^^^^^ help: remove the `-> ()`
2424
2525error: unneeded unit return type
26- --> $DIR/unused_unit.rs:20:27
26+ --> $DIR/unused_unit.rs:20:26
2727 |
2828LL | let _y: &dyn Fn() -> () = &f;
29- | ^^^^^ help: remove the `-> ()`
29+ | ^ ^^^^^ help: remove the `-> ()`
3030
3131error: unneeded unit return type
32- --> $DIR/unused_unit.rs:27:19
32+ --> $DIR/unused_unit.rs:27:18
3333 |
3434LL | fn into(self) -> () {
35- | ^^^^^ help: remove the `-> ()`
35+ | ^ ^^^^^ help: remove the `-> ()`
3636
3737error: unneeded unit expression
3838 --> $DIR/unused_unit.rs:28:9
@@ -41,46 +41,46 @@ LL | ()
4141 | ^^ help: remove the final `()`
4242
4343error: unneeded unit return type
44- --> $DIR/unused_unit.rs:33:30
44+ --> $DIR/unused_unit.rs:33:29
4545 |
4646LL | fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
47- | ^^^^^ help: remove the `-> ()`
47+ | ^ ^^^^^ help: remove the `-> ()`
4848
4949error: unneeded unit return type
50- --> $DIR/unused_unit.rs:35:20
50+ --> $DIR/unused_unit.rs:35:19
5151 |
5252LL | G: FnMut() -> (),
53- | ^^^^^ help: remove the `-> ()`
53+ | ^ ^^^^^ help: remove the `-> ()`
5454
5555error: unneeded unit return type
56- --> $DIR/unused_unit.rs:36:17
56+ --> $DIR/unused_unit.rs:36:16
5757 |
5858LL | H: Fn() -> ();
59- | ^^^^^ help: remove the `-> ()`
59+ | ^ ^^^^^ help: remove the `-> ()`
6060
6161error: unneeded unit return type
62- --> $DIR/unused_unit.rs:40:30
62+ --> $DIR/unused_unit.rs:40:29
6363 |
6464LL | fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
65- | ^^^^^ help: remove the `-> ()`
65+ | ^ ^^^^^ help: remove the `-> ()`
6666
6767error: unneeded unit return type
68- --> $DIR/unused_unit.rs:42:20
68+ --> $DIR/unused_unit.rs:42:19
6969 |
7070LL | G: FnMut() -> (),
71- | ^^^^^ help: remove the `-> ()`
71+ | ^ ^^^^^ help: remove the `-> ()`
7272
7373error: unneeded unit return type
74- --> $DIR/unused_unit.rs:43:17
74+ --> $DIR/unused_unit.rs:43:16
7575 |
7676LL | H: Fn() -> () {}
77- | ^^^^^ help: remove the `-> ()`
77+ | ^ ^^^^^ help: remove the `-> ()`
7878
7979error: unneeded unit return type
80- --> $DIR/unused_unit.rs:46:18
80+ --> $DIR/unused_unit.rs:46:17
8181 |
8282LL | fn return_unit() -> () { () }
83- | ^^^^^ help: remove the `-> ()`
83+ | ^ ^^^^^ help: remove the `-> ()`
8484
8585error: unneeded unit expression
8686 --> $DIR/unused_unit.rs:46:26
@@ -100,5 +100,23 @@ error: unneeded `()`
100100LL | return();
101101 | ^^ help: remove the `()`
102102
103- error: aborting due to 16 previous errors
103+ error: unneeded unit return type
104+ --> $DIR/unused_unit.rs:75:10
105+ |
106+ LL | fn test()->(){}
107+ | ^^^^ help: remove the `-> ()`
108+
109+ error: unneeded unit return type
110+ --> $DIR/unused_unit.rs:78:11
111+ |
112+ LL | fn test2() ->(){}
113+ | ^^^^^ help: remove the `-> ()`
114+
115+ error: unneeded unit return type
116+ --> $DIR/unused_unit.rs:81:11
117+ |
118+ LL | fn test3()-> (){}
119+ | ^^^^^ help: remove the `-> ()`
120+
121+ error: aborting due to 19 previous errors
104122
0 commit comments