@@ -2,117 +2,230 @@ error: parameter is only used in recursion
2
2
--> $DIR/only_used_in_recursion.rs:11:27
3
3
|
4
4
LL | fn _one_unused(flag: u32, a: usize) -> usize {
5
- | ^
5
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
6
6
|
7
7
= note: `-D clippy::only-used-in-recursion` implied by `-D warnings`
8
+ note: parameter used here
9
+ --> $DIR/only_used_in_recursion.rs:12:53
10
+ |
11
+ LL | if flag == 0 { 0 } else { _one_unused(flag - 1, a) }
12
+ | ^
8
13
9
14
error: parameter is only used in recursion
10
15
--> $DIR/only_used_in_recursion.rs:15:27
11
16
|
12
17
LL | fn _two_unused(flag: u32, a: u32, b: i32) -> usize {
13
- | ^
18
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
19
+ |
20
+ note: parameter used here
21
+ --> $DIR/only_used_in_recursion.rs:16:53
22
+ |
23
+ LL | if flag == 0 { 0 } else { _two_unused(flag - 1, a, b) }
24
+ | ^
14
25
15
26
error: parameter is only used in recursion
16
27
--> $DIR/only_used_in_recursion.rs:15:35
17
28
|
18
29
LL | fn _two_unused(flag: u32, a: u32, b: i32) -> usize {
19
- | ^
30
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
31
+ |
32
+ note: parameter used here
33
+ --> $DIR/only_used_in_recursion.rs:16:56
34
+ |
35
+ LL | if flag == 0 { 0 } else { _two_unused(flag - 1, a, b) }
36
+ | ^
20
37
21
38
error: parameter is only used in recursion
22
39
--> $DIR/only_used_in_recursion.rs:19:26
23
40
|
24
41
LL | fn _with_calc(flag: u32, a: i64) -> usize {
25
- | ^
42
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
43
+ |
44
+ note: parameter used here
45
+ --> $DIR/only_used_in_recursion.rs:23:32
46
+ |
47
+ LL | _with_calc(flag - 1, (-a + 10) * 5)
48
+ | ^
26
49
27
50
error: parameter is only used in recursion
28
51
--> $DIR/only_used_in_recursion.rs:32:33
29
52
|
30
53
LL | fn _used_with_unused(flag: u32, a: i32, b: i32) -> usize {
31
- | ^
54
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
55
+ |
56
+ note: parameter used here
57
+ --> $DIR/only_used_in_recursion.rs:36:38
58
+ |
59
+ LL | _used_with_unused(flag - 1, -a, a + b)
60
+ | ^ ^
32
61
33
62
error: parameter is only used in recursion
34
63
--> $DIR/only_used_in_recursion.rs:32:41
35
64
|
36
65
LL | fn _used_with_unused(flag: u32, a: i32, b: i32) -> usize {
37
- | ^
66
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
67
+ |
68
+ note: parameter used here
69
+ --> $DIR/only_used_in_recursion.rs:36:45
70
+ |
71
+ LL | _used_with_unused(flag - 1, -a, a + b)
72
+ | ^
38
73
39
74
error: parameter is only used in recursion
40
75
--> $DIR/only_used_in_recursion.rs:40:35
41
76
|
42
77
LL | fn _codependent_unused(flag: u32, a: i32, b: i32) -> usize {
43
- | ^
78
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
79
+ |
80
+ note: parameter used here
81
+ --> $DIR/only_used_in_recursion.rs:44:39
82
+ |
83
+ LL | _codependent_unused(flag - 1, a * b, a + b)
84
+ | ^ ^
44
85
45
86
error: parameter is only used in recursion
46
87
--> $DIR/only_used_in_recursion.rs:40:43
47
88
|
48
89
LL | fn _codependent_unused(flag: u32, a: i32, b: i32) -> usize {
49
- | ^
90
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
91
+ |
92
+ note: parameter used here
93
+ --> $DIR/only_used_in_recursion.rs:44:43
94
+ |
95
+ LL | _codependent_unused(flag - 1, a * b, a + b)
96
+ | ^ ^
50
97
51
98
error: parameter is only used in recursion
52
99
--> $DIR/only_used_in_recursion.rs:48:30
53
100
|
54
101
LL | fn _not_primitive(flag: u32, b: String) -> usize {
55
- | ^
102
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
103
+ |
104
+ note: parameter used here
105
+ --> $DIR/only_used_in_recursion.rs:49:56
106
+ |
107
+ LL | if flag == 0 { 0 } else { _not_primitive(flag - 1, b) }
108
+ | ^
56
109
57
110
error: parameter is only used in recursion
58
111
--> $DIR/only_used_in_recursion.rs:55:29
59
112
|
60
113
LL | fn _method(flag: usize, a: usize) -> usize {
61
- | ^
114
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
115
+ |
116
+ note: parameter used here
117
+ --> $DIR/only_used_in_recursion.rs:56:59
118
+ |
119
+ LL | if flag == 0 { 0 } else { Self::_method(flag - 1, a) }
120
+ | ^
62
121
63
122
error: parameter is only used in recursion
64
123
--> $DIR/only_used_in_recursion.rs:59:22
65
124
|
66
125
LL | fn _method_self(&self, flag: usize, a: usize) -> usize {
67
- | ^^^^
126
+ | ^^^^ help: if this is intentional, prefix it with an underscore: `_self`
127
+ |
128
+ note: parameter used here
129
+ --> $DIR/only_used_in_recursion.rs:60:35
130
+ |
131
+ LL | if flag == 0 { 0 } else { self._method_self(flag - 1, a) }
132
+ | ^^^^
68
133
69
134
error: parameter is only used in recursion
70
135
--> $DIR/only_used_in_recursion.rs:59:41
71
136
|
72
137
LL | fn _method_self(&self, flag: usize, a: usize) -> usize {
73
- | ^
138
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
139
+ |
140
+ note: parameter used here
141
+ --> $DIR/only_used_in_recursion.rs:60:63
142
+ |
143
+ LL | if flag == 0 { 0 } else { self._method_self(flag - 1, a) }
144
+ | ^
74
145
75
146
error: parameter is only used in recursion
76
147
--> $DIR/only_used_in_recursion.rs:70:26
77
148
|
78
149
LL | fn method(flag: u32, a: usize) -> usize {
79
- | ^
150
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
151
+ |
152
+ note: parameter used here
153
+ --> $DIR/only_used_in_recursion.rs:71:58
154
+ |
155
+ LL | if flag == 0 { 0 } else { Self::method(flag - 1, a) }
156
+ | ^
80
157
81
158
error: parameter is only used in recursion
82
159
--> $DIR/only_used_in_recursion.rs:74:38
83
160
|
84
161
LL | fn method_self(&self, flag: u32, a: usize) -> usize {
85
- | ^
162
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
163
+ |
164
+ note: parameter used here
165
+ --> $DIR/only_used_in_recursion.rs:75:62
166
+ |
167
+ LL | if flag == 0 { 0 } else { self.method_self(flag - 1, a) }
168
+ | ^
86
169
87
170
error: parameter is only used in recursion
88
171
--> $DIR/only_used_in_recursion.rs:100:26
89
172
|
90
173
LL | fn method(flag: u32, a: usize) -> usize {
91
- | ^
174
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
175
+ |
176
+ note: parameter used here
177
+ --> $DIR/only_used_in_recursion.rs:101:58
178
+ |
179
+ LL | if flag == 0 { 0 } else { Self::method(flag - 1, a) }
180
+ | ^
92
181
93
182
error: parameter is only used in recursion
94
183
--> $DIR/only_used_in_recursion.rs:104:38
95
184
|
96
185
LL | fn method_self(&self, flag: u32, a: usize) -> usize {
97
- | ^
186
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
187
+ |
188
+ note: parameter used here
189
+ --> $DIR/only_used_in_recursion.rs:105:62
190
+ |
191
+ LL | if flag == 0 { 0 } else { self.method_self(flag - 1, a) }
192
+ | ^
98
193
99
194
error: parameter is only used in recursion
100
195
--> $DIR/only_used_in_recursion.rs:113:35
101
196
|
102
197
LL | fn _with_inner(flag: u32, a: u32, b: u32) -> usize {
103
- | ^
198
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
199
+ |
200
+ note: parameter used here
201
+ --> $DIR/only_used_in_recursion.rs:119:52
202
+ |
203
+ LL | if flag == 0 { 0 } else { _with_inner(flag, a, b + x) }
204
+ | ^
104
205
105
206
error: parameter is only used in recursion
106
207
--> $DIR/only_used_in_recursion.rs:114:25
107
208
|
108
209
LL | fn inner(flag: u32, a: u32) -> u32 {
109
- | ^
210
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
211
+ |
212
+ note: parameter used here
213
+ --> $DIR/only_used_in_recursion.rs:115:47
214
+ |
215
+ LL | if flag == 0 { 0 } else { inner(flag, a) }
216
+ | ^
110
217
111
218
error: parameter is only used in recursion
112
219
--> $DIR/only_used_in_recursion.rs:122:34
113
220
|
114
221
LL | fn _with_closure(a: Option<u32>, b: u32, f: impl Fn(u32, u32) -> Option<u32>) -> u32 {
115
- | ^
222
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
223
+ |
224
+ note: parameter used here
225
+ --> $DIR/only_used_in_recursion.rs:124:32
226
+ |
227
+ LL | _with_closure(Some(x), b, f)
228
+ | ^
116
229
117
230
error: aborting due to 19 previous errors
118
231
0 commit comments