|
1 | 1 | error: passing a unit value to a function |
2 | | - --> $DIR/unit_arg.rs:24:9 |
| 2 | + --> $DIR/unit_arg.rs:24:5 |
3 | 3 | | |
4 | 4 | LL | foo({}); |
5 | | - | ^^ |
| 5 | + | ^^^^^^^ |
6 | 6 | | |
7 | 7 | = note: `-D clippy::unit-arg` implied by `-D warnings` |
8 | | -help: if you intended to pass a unit value, use a unit literal instead |
| 8 | +help: move the expressions in front of the call... |
| 9 | + | |
| 10 | +LL | {}; foo({}); |
| 11 | + | ^^^ |
| 12 | +help: ...and use unit literals instead |
9 | 13 | | |
10 | 14 | LL | foo(()); |
11 | 15 | | ^^ |
12 | 16 |
|
13 | 17 | error: passing a unit value to a function |
14 | | - --> $DIR/unit_arg.rs:25:9 |
| 18 | + --> $DIR/unit_arg.rs:25:5 |
15 | 19 | | |
16 | | -LL | foo({ |
17 | | - | _________^ |
| 20 | +LL | / foo({ |
18 | 21 | LL | | 1; |
19 | 22 | LL | | }); |
20 | | - | |_____^ |
21 | | -help: if you intended to pass a unit value, use a unit literal instead |
| 23 | + | |______^ |
| 24 | +help: move the expressions in front of the call... |
| 25 | + | |
| 26 | +LL | { |
| 27 | +LL | 1; |
| 28 | +LL | }; foo({ |
| 29 | + | |
| 30 | +help: ...and use unit literals instead |
22 | 31 | | |
23 | 32 | LL | foo(()); |
24 | 33 | | ^^ |
25 | 34 |
|
26 | 35 | error: passing a unit value to a function |
27 | | - --> $DIR/unit_arg.rs:28:9 |
| 36 | + --> $DIR/unit_arg.rs:28:5 |
28 | 37 | | |
29 | 38 | LL | foo(foo(1)); |
30 | | - | ^^^^^^ |
31 | | -help: if you intended to pass a unit value, use a unit literal instead |
| 39 | + | ^^^^^^^^^^^ |
| 40 | +help: move the expressions in front of the call... |
| 41 | + | |
| 42 | +LL | foo(1); foo(foo(1)); |
| 43 | + | ^^^^^^^ |
| 44 | +help: ...and use unit literals instead |
32 | 45 | | |
33 | 46 | LL | foo(()); |
34 | 47 | | ^^ |
35 | 48 |
|
36 | 49 | error: passing a unit value to a function |
37 | | - --> $DIR/unit_arg.rs:29:9 |
| 50 | + --> $DIR/unit_arg.rs:29:5 |
38 | 51 | | |
39 | | -LL | foo({ |
40 | | - | _________^ |
| 52 | +LL | / foo({ |
41 | 53 | LL | | foo(1); |
42 | 54 | LL | | foo(2); |
43 | 55 | LL | | }); |
44 | | - | |_____^ |
45 | | -help: if you intended to pass a unit value, use a unit literal instead |
| 56 | + | |______^ |
| 57 | +help: move the expressions in front of the call... |
| 58 | + | |
| 59 | +LL | { |
| 60 | +LL | foo(1); |
| 61 | +LL | foo(2); |
| 62 | +LL | }; foo({ |
| 63 | + | |
| 64 | +help: ...and use unit literals instead |
46 | 65 | | |
47 | 66 | LL | foo(()); |
48 | 67 | | ^^ |
49 | 68 |
|
50 | 69 | error: passing a unit value to a function |
51 | | - --> $DIR/unit_arg.rs:33:10 |
| 70 | + --> $DIR/unit_arg.rs:33:5 |
52 | 71 | | |
53 | 72 | LL | foo3({}, 2, 2); |
54 | | - | ^^ |
55 | | -help: if you intended to pass a unit value, use a unit literal instead |
| 73 | + | ^^^^^^^^^^^^^^ |
| 74 | +help: move the expressions in front of the call... |
| 75 | + | |
| 76 | +LL | {}; foo3({}, 2, 2); |
| 77 | + | ^^^ |
| 78 | +help: ...and use unit literals instead |
56 | 79 | | |
57 | 80 | LL | foo3((), 2, 2); |
58 | 81 | | ^^ |
59 | 82 |
|
60 | 83 | error: passing a unit value to a function |
61 | | - --> $DIR/unit_arg.rs:35:11 |
| 84 | + --> $DIR/unit_arg.rs:35:5 |
62 | 85 | | |
63 | | -LL | b.bar({ |
64 | | - | ___________^ |
| 86 | +LL | / b.bar({ |
65 | 87 | LL | | 1; |
66 | 88 | LL | | }); |
67 | | - | |_____^ |
68 | | -help: if you intended to pass a unit value, use a unit literal instead |
| 89 | + | |______^ |
| 90 | +help: move the expressions in front of the call... |
| 91 | + | |
| 92 | +LL | { |
| 93 | +LL | 1; |
| 94 | +LL | }; b.bar({ |
| 95 | + | |
| 96 | +help: ...and use unit literals instead |
69 | 97 | | |
70 | 98 | LL | b.bar(()); |
71 | 99 | | ^^ |
72 | 100 |
|
73 | | -error: aborting due to 6 previous errors |
| 101 | +error: passing a unit value to a function |
| 102 | + --> $DIR/unit_arg.rs:38:5 |
| 103 | + | |
| 104 | +LL | taking_multiple_units(foo(0), foo(1)); |
| 105 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 106 | +help: move the expressions in front of the call... |
| 107 | + | |
| 108 | +LL | foo(0); foo(1); taking_multiple_units(foo(0), foo(1)); |
| 109 | + | ^^^^^^^^^^^^^^^ |
| 110 | +help: ...and use unit literals instead |
| 111 | + | |
| 112 | +LL | taking_multiple_units((), ()); |
| 113 | + | ^^ ^^ |
| 114 | + |
| 115 | +error: passing a unit value to a function |
| 116 | + --> $DIR/unit_arg.rs:70:5 |
| 117 | + | |
| 118 | +LL | Some(foo(1)) |
| 119 | + | ^^^^^^^^^^^^ |
| 120 | +help: move the expressions in front of the call... |
| 121 | + | |
| 122 | +LL | foo(1); Some(foo(1)) |
| 123 | + | ^^^^^^^ |
| 124 | +help: ...and use unit literals instead |
| 125 | + | |
| 126 | +LL | Some(()) |
| 127 | + | ^^ |
| 128 | + |
| 129 | +error: aborting due to 8 previous errors |
74 | 130 |
|
0 commit comments