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