2018-01-18 16:02:18 -06:00
|
|
|
error: passing a unit value to a function
|
2020-06-09 09:36:01 -05:00
|
|
|
--> $DIR/unit_arg.rs:23:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | / foo({
|
|
|
|
LL | | 1;
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::unit-arg` implied by `-D warnings`
|
2020-06-09 09:36:01 -05:00
|
|
|
help: remove the semicolon from the last statement in the block
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | 1
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
help: or move the expression in front of the call...
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | {
|
|
|
|
LL | 1;
|
|
|
|
LL | };
|
|
|
|
|
|
|
|
|
help: ...and use a unit literal instead
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | foo(());
|
2018-01-18 16:02:18 -06:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-06-09 09:36:01 -05:00
|
|
|
--> $DIR/unit_arg.rs:26:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | foo(foo(1));
|
2020-06-09 09:36:01 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: move the expression in front of the call...
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | foo(1);
|
|
|
|
|
|
|
|
|
help: ...and use a unit literal instead
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | foo(());
|
2018-01-18 16:02:18 -06:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-06-09 09:36:01 -05:00
|
|
|
--> $DIR/unit_arg.rs:27:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | / foo({
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | foo(1);
|
|
|
|
LL | | foo(2);
|
|
|
|
LL | | });
|
2020-06-09 09:36:01 -05:00
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(2)
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
help: or move the expression in front of the call...
|
|
|
|
|
|
|
|
|
LL | {
|
|
|
|
LL | foo(1);
|
|
|
|
LL | foo(2);
|
|
|
|
LL | };
|
|
|
|
|
|
|
|
|
help: ...and use a unit literal instead
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | foo(());
|
2018-01-18 16:02:18 -06:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2020-06-09 09:36:01 -05:00
|
|
|
--> $DIR/unit_arg.rs:32:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | / b.bar({
|
|
|
|
LL | | 1;
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
help: remove the semicolon from the last statement in the block
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | 1
|
|
|
|
|
|
|
|
|
help: or move the expression in front of the call...
|
|
|
|
|
|
|
|
|
LL | {
|
|
|
|
LL | 1;
|
|
|
|
LL | };
|
|
|
|
|
|
|
|
|
help: ...and use a unit literal instead
|
|
|
|
|
|
|
|
|
LL | b.bar(());
|
|
|
|
| ^^
|
2018-01-18 16:02:18 -06:00
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
error: passing unit values to a function
|
|
|
|
--> $DIR/unit_arg.rs:35:5
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | taking_multiple_units(foo(0), foo(1));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: move the expressions in front of the call...
|
|
|
|
|
|
|
|
|
LL | foo(0);
|
|
|
|
LL | foo(1);
|
|
|
|
|
|
|
|
|
help: ...and use unit literals instead
|
|
|
|
|
|
|
|
|
LL | taking_multiple_units((), ());
|
|
|
|
| ^^ ^^
|
|
|
|
|
|
|
|
error: passing unit values to a function
|
|
|
|
--> $DIR/unit_arg.rs:36:5
|
|
|
|
|
|
|
|
|
LL | / taking_multiple_units(foo(0), {
|
|
|
|
LL | | foo(1);
|
|
|
|
LL | | foo(2);
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | });
|
2020-06-09 09:36:01 -05:00
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(2)
|
|
|
|
|
|
|
|
|
help: or move the expressions in front of the call...
|
|
|
|
|
|
|
|
|
LL | foo(0);
|
|
|
|
LL | {
|
|
|
|
LL | foo(1);
|
|
|
|
LL | foo(2);
|
|
|
|
LL | };
|
|
|
|
|
|
|
|
|
help: ...and use unit literals instead
|
|
|
|
|
|
|
|
|
LL | taking_multiple_units((), ());
|
|
|
|
| ^^ ^^
|
|
|
|
|
|
|
|
error: passing unit values to a function
|
|
|
|
--> $DIR/unit_arg.rs:40:5
|
|
|
|
|
|
|
|
|
LL | / taking_multiple_units(
|
|
|
|
LL | | {
|
|
|
|
LL | | foo(0);
|
|
|
|
LL | | foo(1);
|
|
|
|
... |
|
|
|
|
LL | | },
|
|
|
|
LL | | );
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
help: remove the semicolon from the last statement in the block
|
2018-01-18 16:02:18 -06:00
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
LL | foo(1)
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(3)
|
|
|
|
|
|
|
|
|
help: or move the expressions in front of the call...
|
|
|
|
|
|
|
|
|
LL | {
|
|
|
|
LL | foo(0);
|
|
|
|
LL | foo(1);
|
|
|
|
LL | };
|
|
|
|
LL | {
|
|
|
|
LL | foo(2);
|
|
|
|
...
|
|
|
|
help: ...and use unit literals instead
|
|
|
|
|
|
|
|
|
LL | (),
|
|
|
|
LL | (),
|
|
|
|
|
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
|
|
|
--> $DIR/unit_arg.rs:82:5
|
|
|
|
|
|
|
|
|
LL | Some(foo(1))
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: move the expression in front of the call...
|
|
|
|
|
|
|
|
|
LL | foo(1);
|
|
|
|
|
|
|
|
|
help: ...and use a unit literal instead
|
|
|
|
|
|
|
|
|
LL | Some(())
|
|
|
|
| ^^
|
2018-01-18 16:02:18 -06:00
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
error: aborting due to 8 previous errors
|
2018-01-18 16:02:18 -06:00
|
|
|
|