rust/tests/ui/unit_arg.stderr

182 lines
3.5 KiB
Text
Raw Normal View History

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