mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 10:33:27 +00:00
52 lines
1.2 KiB
Text
52 lines
1.2 KiB
Text
|
error: passing a unit value to a function
|
||
|
--> $DIR/unit_arg_empty_blocks.rs:15:5
|
||
|
|
|
||
|
LL | foo({});
|
||
|
| ^^^^--^
|
||
|
| |
|
||
|
| help: use a unit literal instead: `()`
|
||
|
|
|
||
|
= note: `-D clippy::unit-arg` implied by `-D warnings`
|
||
|
|
||
|
error: passing a unit value to a function
|
||
|
--> $DIR/unit_arg_empty_blocks.rs:16:5
|
||
|
|
|
||
|
LL | foo3({}, 2, 2);
|
||
|
| ^^^^^--^^^^^^^
|
||
|
| |
|
||
|
| help: use a unit literal instead: `()`
|
||
|
|
||
|
error: passing unit values to a function
|
||
|
--> $DIR/unit_arg_empty_blocks.rs:17:5
|
||
|
|
|
||
|
LL | taking_two_units({}, foo(0));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
|
||
|
help: move the expression in front of the call...
|
||
|
|
|
||
|
LL | foo(0);
|
||
|
|
|
||
|
help: ...and use unit literals instead
|
||
|
|
|
||
|
LL | taking_two_units((), ());
|
||
|
| ^^ ^^
|
||
|
|
||
|
error: passing unit values to a function
|
||
|
--> $DIR/unit_arg_empty_blocks.rs:18:5
|
||
|
|
|
||
|
LL | taking_three_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_three_units((), (), ());
|
||
|
| ^^ ^^ ^^
|
||
|
|
||
|
error: aborting due to 4 previous errors
|
||
|
|