mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 20:13:24 +00:00
181 lines
3.5 KiB
Text
181 lines
3.5 KiB
Text
error: passing a unit value to a function
|
|
--> $DIR/unit_arg.rs:23:5
|
|
|
|
|
LL | / foo({
|
|
LL | | 1;
|
|
LL | | });
|
|
| |______^
|
|
|
|
|
= note: `-D clippy::unit-arg` implied by `-D warnings`
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
LL | 1
|
|
|
|
|
help: or move the expression in front of the call...
|
|
|
|
|
LL | {
|
|
LL | 1;
|
|
LL | };
|
|
|
|
|
help: ...and use a unit literal instead
|
|
|
|
|
LL | foo(());
|
|
| ^^
|
|
|
|
error: passing a unit value to a function
|
|
--> $DIR/unit_arg.rs:26:5
|
|
|
|
|
LL | foo(foo(1));
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: move the expression in front of the call...
|
|
|
|
|
LL | foo(1);
|
|
|
|
|
help: ...and use a unit literal instead
|
|
|
|
|
LL | foo(());
|
|
| ^^
|
|
|
|
error: passing a unit value to a function
|
|
--> $DIR/unit_arg.rs:27:5
|
|
|
|
|
LL | / foo({
|
|
LL | | foo(1);
|
|
LL | | foo(2);
|
|
LL | | });
|
|
| |______^
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
LL | foo(2)
|
|
|
|
|
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
|
|
|
|
|
LL | foo(());
|
|
| ^^
|
|
|
|
error: passing a unit value to a function
|
|
--> $DIR/unit_arg.rs:32:5
|
|
|
|
|
LL | / b.bar({
|
|
LL | | 1;
|
|
LL | | });
|
|
| |______^
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
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(());
|
|
| ^^
|
|
|
|
error: passing unit values to a function
|
|
--> $DIR/unit_arg.rs:35:5
|
|
|
|
|
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);
|
|
LL | | });
|
|
| |______^
|
|
|
|
|
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 | | );
|
|
| |_____^
|
|
|
|
|
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)
|
|
|
|
|
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(())
|
|
| ^^
|
|
|
|
error: aborting due to 8 previous errors
|
|
|