1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
error: the following explicit lifetimes could be elided: 'a, 'b
--> tests/ui/elidable_lifetime_names.rs:9:21
|
LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
| ^^ ^^ ^^ ^^
|
= note: `-D clippy::elidable-lifetime-names` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::elidable_lifetime_names)]`
help: elide the lifetimes
|
LL - fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
LL + fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {}
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:34:15
|
LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
| ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
LL + fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I>
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:44:19
|
LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
| ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
LL + fn struct_with_lt(_foo: Foo<'_>) -> &str {
|
error: the following explicit lifetimes could be elided: 'b
--> tests/ui/elidable_lifetime_names.rs:59:25
|
LL | fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
| ^^ ^^
|
help: elide the lifetimes
|
LL - fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
LL + fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str {
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:66:18
|
LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
| ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
LL + fn alias_with_lt(_foo: FooAlias<'_>) -> &str {
|
error: the following explicit lifetimes could be elided: 'b
--> tests/ui/elidable_lifetime_names.rs:81:24
|
LL | fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
| ^^ ^^
|
help: elide the lifetimes
|
LL - fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
LL + fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str {
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:91:24
|
LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
| ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
LL + fn out_return_type_lts(e: &str) -> Cow<'_> {
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:103:10
|
LL | impl<'a> Foo for Baz<'a> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a> Foo for Baz<'a> {}
LL + impl Foo for Baz<'_> {}
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:106:16
|
LL | fn baz<'a>(&'a self) -> impl Foo + 'a {
| ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - fn baz<'a>(&'a self) -> impl Foo + 'a {
LL + fn baz(&self) -> impl Foo + '_ {
|
error: the following explicit lifetimes could be elided: 'py
--> tests/ui/elidable_lifetime_names.rs:139:14
|
LL | impl<'t, 'py> ContentString<'t> {
| ^^^
LL | // `'py` can be elided because of `&self`
LL | fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
| ^^^
|
help: elide the lifetimes
|
LL ~ impl<'t> ContentString<'t> {
LL | // `'py` can be elided because of `&self`
LL ~ fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
|
error: the following explicit lifetimes could be elided: 'py
--> tests/ui/elidable_lifetime_names.rs:150:14
|
LL | impl<'t, 'py> ContentString<'t> {
| ^^^
LL | // `'py` can be elided because of `&'_ self`
LL | fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
| ^^^
|
help: elide the lifetimes
|
LL ~ impl<'t> ContentString<'t> {
LL | // `'py` can be elided because of `&'_ self`
LL ~ fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
|
error: the following explicit lifetimes could be elided: 'py
--> tests/ui/elidable_lifetime_names.rs:171:14
|
LL | impl<'t, 'py> ContentString<'t> {
| ^^^
...
LL | ) -> Content<'t, 'py> {
| ^^^
|
help: elide the lifetimes
|
LL ~ impl<'t> ContentString<'t> {
LL | // `'py` can be elided because of `&Self`
...
LL | o: &'t str,
LL ~ ) -> Content<'t, '_> {
|
error: the following explicit lifetimes could be elided: 'a, 's
--> tests/ui/elidable_lifetime_names.rs:202:15
|
LL | impl<'de, 'a, 's> Trait<'de> for UnitVariantAccess<'a, 'de, 's> {}
| ^^ ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'de, 'a, 's> Trait<'de> for UnitVariantAccess<'a, 'de, 's> {}
LL + impl<'de> Trait<'de> for UnitVariantAccess<'_, 'de, '_> {}
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:226:10
|
LL | impl<'a> T for S1<'a> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a> T for S1<'a> {}
LL + impl T for S1<'_> {}
|
error: the following explicit lifetimes could be elided: 'b
--> tests/ui/elidable_lifetime_names.rs:234:14
|
LL | impl<'a, 'b> TA<'a> for S2<'a, 'b> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b> TA<'a> for S2<'a, 'b> {}
LL + impl<'a> TA<'a> for S2<'a, '_> {}
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:238:10
|
LL | impl<'a, 'b> TB<'b> for S2<'a, 'b> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b> TB<'b> for S2<'a, 'b> {}
LL + impl<'b> TB<'b> for S2<'_, 'b> {}
|
error: the following explicit lifetimes could be elided: 'a, 'b
--> tests/ui/elidable_lifetime_names.rs:242:10
|
LL | impl<'a, 'b> T for S2<'a, 'b> {}
| ^^ ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b> T for S2<'a, 'b> {}
LL + impl T for S2<'_, '_> {}
|
error: the following explicit lifetimes could be elided: 'c
--> tests/ui/elidable_lifetime_names.rs:250:18
|
LL | impl<'a, 'b, 'c> TAB<'a, 'b> for S3<'a, 'b, 'c> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> TAB<'a, 'b> for S3<'a, 'b, 'c> {}
LL + impl<'a, 'b> TAB<'a, 'b> for S3<'a, 'b, '_> {}
|
error: the following explicit lifetimes could be elided: 'b
--> tests/ui/elidable_lifetime_names.rs:254:14
|
LL | impl<'a, 'b, 'c> TAC<'a, 'c> for S3<'a, 'b, 'c> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> TAC<'a, 'c> for S3<'a, 'b, 'c> {}
LL + impl<'a, 'c> TAC<'a, 'c> for S3<'a, '_, 'c> {}
|
error: the following explicit lifetimes could be elided: 'b, 'c
--> tests/ui/elidable_lifetime_names.rs:258:14
|
LL | impl<'a, 'b, 'c> TA<'a> for S3<'a, 'b, 'c> {}
| ^^ ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> TA<'a> for S3<'a, 'b, 'c> {}
LL + impl<'a> TA<'a> for S3<'a, '_, '_> {}
|
error: the following explicit lifetimes could be elided: 'a
--> tests/ui/elidable_lifetime_names.rs:262:10
|
LL | impl<'a, 'b, 'c> TBC<'b, 'c> for S3<'a, 'b, 'c> {}
| ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> TBC<'b, 'c> for S3<'a, 'b, 'c> {}
LL + impl<'b, 'c> TBC<'b, 'c> for S3<'_, 'b, 'c> {}
|
error: the following explicit lifetimes could be elided: 'a, 'c
--> tests/ui/elidable_lifetime_names.rs:266:10
|
LL | impl<'a, 'b, 'c> TB<'b> for S3<'a, 'b, 'c> {}
| ^^ ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> TB<'b> for S3<'a, 'b, 'c> {}
LL + impl<'b> TB<'b> for S3<'_, 'b, '_> {}
|
error: the following explicit lifetimes could be elided: 'a, 'b
--> tests/ui/elidable_lifetime_names.rs:270:10
|
LL | impl<'a, 'b, 'c> TC<'c> for S3<'a, 'b, 'c> {}
| ^^ ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> TC<'c> for S3<'a, 'b, 'c> {}
LL + impl<'c> TC<'c> for S3<'_, '_, 'c> {}
|
error: the following explicit lifetimes could be elided: 'a, 'b, 'c
--> tests/ui/elidable_lifetime_names.rs:274:10
|
LL | impl<'a, 'b, 'c> T for S3<'a, 'b, 'c> {}
| ^^ ^^ ^^ ^^ ^^ ^^
|
help: elide the lifetimes
|
LL - impl<'a, 'b, 'c> T for S3<'a, 'b, 'c> {}
LL + impl T for S3<'_, '_, '_> {}
|
error: aborting due to 24 previous errors
|