2018-01-18 22:02:18 +00:00
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:63:5
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | / foo({
|
|
|
|
LL | | 1;
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::unit-arg` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unit_arg)]`
|
2020-06-09 14:36:01 +00:00
|
|
|
help: remove the semicolon from the last statement in the block
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | 1
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
2019-10-26 19:53:42 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ {
|
|
|
|
LL + 1;
|
|
|
|
LL + };
|
|
|
|
LL ~ foo(());
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:66:5
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | foo(foo(1));
|
2020-06-09 14:36:01 +00:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
2019-10-26 19:53:42 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ foo(1);
|
|
|
|
LL ~ foo(());
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:67:5
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | / foo({
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | foo(1);
|
|
|
|
LL | | foo(2);
|
|
|
|
LL | | });
|
2020-06-09 14:36:01 +00:00
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(2)
|
2019-10-26 19:53:42 +00:00
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ {
|
|
|
|
LL + foo(1);
|
|
|
|
LL + foo(2);
|
|
|
|
LL + };
|
|
|
|
LL ~ foo(());
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:72:5
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | / b.bar({
|
|
|
|
LL | | 1;
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
2019-10-26 19:53:42 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
help: remove the semicolon from the last statement in the block
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | 1
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ {
|
|
|
|
LL + 1;
|
|
|
|
LL + };
|
|
|
|
LL ~ b.bar(());
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2018-01-18 22:02:18 +00:00
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
error: passing unit values to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:75:5
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | taking_multiple_units(foo(0), foo(1));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: move the expressions in front of the call and replace them with the unit literal `()`
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ foo(0);
|
|
|
|
LL + foo(1);
|
|
|
|
LL ~ taking_multiple_units((), ());
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
|
|
error: passing unit values to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:76:5
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
|
|
|
LL | / taking_multiple_units(foo(0), {
|
|
|
|
LL | | foo(1);
|
|
|
|
LL | | foo(2);
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | });
|
2020-06-09 14:36:01 +00:00
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(2)
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: or move the expressions in front of the call and replace them with the unit literal `()`
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ foo(0);
|
|
|
|
LL + {
|
|
|
|
LL + foo(1);
|
|
|
|
LL + foo(2);
|
|
|
|
LL + };
|
|
|
|
LL ~ taking_multiple_units((), ());
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
|
|
error: passing unit values to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:80:5
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
|
|
|
LL | / taking_multiple_units(
|
|
|
|
LL | | {
|
|
|
|
LL | | foo(0);
|
|
|
|
LL | | foo(1);
|
|
|
|
... |
|
|
|
|
LL | | },
|
|
|
|
LL | | );
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^
|
2019-10-26 19:53:42 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
help: remove the semicolon from the last statement in the block
|
2018-01-18 22:02:18 +00:00
|
|
|
|
|
2020-06-09 14:36:01 +00:00
|
|
|
LL | foo(1)
|
|
|
|
|
|
|
|
|
help: remove the semicolon from the last statement in the block
|
|
|
|
|
|
|
|
|
LL | foo(3)
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: or move the expressions in front of the call and replace them with the unit literal `()`
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ {
|
|
|
|
LL + foo(0);
|
|
|
|
LL + foo(1);
|
|
|
|
LL + };
|
|
|
|
LL + {
|
|
|
|
LL + foo(2);
|
2022-06-16 14:00:32 +00:00
|
|
|
LL + foo(3);
|
|
|
|
LL + };
|
|
|
|
LL + taking_multiple_units(
|
|
|
|
LL + (),
|
|
|
|
LL + (),
|
|
|
|
LL ~ );
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:91:13
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
|
|
|
LL | None.or(Some(foo(2)));
|
|
|
|
| ^^^^^^^^^^^^
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ None.or({
|
|
|
|
LL + foo(2);
|
|
|
|
LL + Some(())
|
|
|
|
LL ~ });
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:94:5
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-03-12 14:30:50 +00:00
|
|
|
LL | foo(foo(()));
|
2020-06-09 14:36:01 +00:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ foo(());
|
|
|
|
LL ~ foo(());
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
|
|
error: passing a unit value to a function
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unit_arg.rs:131:5
|
2020-06-09 14:36:01 +00:00
|
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
LL | Some(foo(1))
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ foo(1);
|
|
|
|
LL + Some(())
|
2020-09-10 15:47:07 +00:00
|
|
|
|
|
2018-01-18 22:02:18 +00:00
|
|
|
|
2020-09-10 15:47:07 +00:00
|
|
|
error: aborting due to 10 previous errors
|
2018-01-18 22:02:18 +00:00
|
|
|
|