2018-01-18 16:02:18 -06:00
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:30:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2019-08-26 12:35:25 -05:00
|
|
|
LL | / foo({
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | 1;
|
|
|
|
LL | | });
|
2019-08-26 12:35:25 -05:00
|
|
|
| |______^
|
|
|
|
|
|
2020-05-31 12:29:36 -05:00
|
|
|
= note: `-D clippy::unit-arg` implied by `-D warnings`
|
2020-02-17 11:12:01 -06:00
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | 1
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
|
|
|
LL | {
|
|
|
|
LL | 1;
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | };
|
|
|
|
LL | foo(());
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:33:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | foo(foo(1));
|
2019-08-26 12:35:25 -05:00
|
|
|
| ^^^^^^^^^^^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | foo(1);
|
|
|
|
LL | foo(());
|
|
|
|
|
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:34:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2019-08-26 12:35:25 -05:00
|
|
|
LL | / foo({
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | foo(1);
|
|
|
|
LL | | foo(2);
|
|
|
|
LL | | });
|
2019-08-26 12:35:25 -05:00
|
|
|
| |______^
|
|
|
|
|
|
2020-02-17 11:12:01 -06:00
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(2)
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
|
|
|
LL | {
|
|
|
|
LL | foo(1);
|
|
|
|
LL | foo(2);
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | };
|
|
|
|
LL | foo(());
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:39:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2019-08-26 12:35:25 -05:00
|
|
|
LL | / b.bar({
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | 1;
|
|
|
|
LL | | });
|
2019-08-26 12:35:25 -05:00
|
|
|
| |______^
|
|
|
|
|
|
2020-02-17 11:12:01 -06:00
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | 1
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2019-08-26 12:35:25 -05:00
|
|
|
LL | {
|
|
|
|
LL | 1;
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | };
|
|
|
|
LL | b.bar(());
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
2018-01-18 16:02:18 -06:00
|
|
|
|
2020-02-17 11:12:01 -06:00
|
|
|
error: passing unit values to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:42:5
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
|
|
|
LL | taking_multiple_units(foo(0), foo(1));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: move the expressions in front of the call and replace them with the unit literal `()`
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | foo(0);
|
|
|
|
LL | foo(1);
|
|
|
|
LL | taking_multiple_units((), ());
|
|
|
|
|
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
|
|
error: passing unit values to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:43:5
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
|
|
|
LL | / taking_multiple_units(foo(0), {
|
|
|
|
LL | | foo(1);
|
|
|
|
LL | | foo(2);
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(2)
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: or move the expressions in front of the call and replace them with the unit literal `()`
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | foo(0);
|
|
|
|
LL | {
|
2020-02-17 11:12:01 -06:00
|
|
|
LL | foo(1);
|
|
|
|
LL | foo(2);
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | };
|
|
|
|
LL | taking_multiple_units((), ());
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
|
|
error: passing unit values to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:47:5
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
|
|
|
LL | / taking_multiple_units(
|
|
|
|
LL | | {
|
|
|
|
LL | | foo(0);
|
|
|
|
LL | | foo(1);
|
|
|
|
... |
|
|
|
|
LL | | },
|
|
|
|
LL | | );
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(1)
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(3)
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: or move the expressions in front of the call and replace them with the unit literal `()`
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
|
|
|
LL | {
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | foo(0);
|
|
|
|
LL | foo(1);
|
|
|
|
LL | };
|
|
|
|
LL | {
|
|
|
|
LL | foo(2);
|
2020-02-17 11:12:01 -06:00
|
|
|
...
|
2020-08-20 17:07:56 -05:00
|
|
|
|
2019-08-26 12:35:25 -05:00
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:58:13
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
LL | None.or(Some(foo(2)));
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | None.or({
|
|
|
|
LL | foo(2);
|
|
|
|
LL | Some(())
|
|
|
|
LL | });
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:61:5
|
2020-08-20 17:07:56 -05:00
|
|
|
|
|
|
|
|
LL | foo(foo(()))
|
2019-08-26 12:35:25 -05:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | foo(());
|
|
|
|
LL | foo(())
|
2020-08-20 17:07:56 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-10-18 03:55:25 -05:00
|
|
|
--> $DIR/unit_arg.rs:94:5
|
2020-08-20 17:07:56 -05:00
|
|
|
|
|
|
|
|
LL | Some(foo(1))
|
|
|
|
| ^^^^^^^^^^^^
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
2020-08-20 17:07:56 -05:00
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
2020-02-17 11:12:01 -06:00
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
LL | foo(1);
|
|
|
|
LL | Some(())
|
2019-08-26 12:35:25 -05:00
|
|
|
|
|
|
|
|
|
2020-08-26 18:40:02 -05:00
|
|
|
error: aborting due to 10 previous errors
|
2018-01-18 16:02:18 -06:00
|
|
|
|