@@ -251,8 +251,8 @@ declare_lint_pass!(Attributes => [
251
251
UNKNOWN_CLIPPY_LINTS ,
252
252
] ) ;
253
253
254
- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for Attributes {
255
- fn check_attribute ( & mut self , cx : & LateContext < ' a , ' tcx > , attr : & ' tcx Attribute ) {
254
+ impl < ' tcx > LateLintPass < ' tcx > for Attributes {
255
+ fn check_attribute ( & mut self , cx : & LateContext < ' tcx > , attr : & ' tcx Attribute ) {
256
256
if let Some ( items) = & attr. meta_item_list ( ) {
257
257
if let Some ( ident) = attr. ident ( ) {
258
258
match & * ident. as_str ( ) {
@@ -278,7 +278,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
278
278
}
279
279
}
280
280
281
- fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx Item < ' _ > ) {
281
+ fn check_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx Item < ' _ > ) {
282
282
if is_relevant_item ( cx, item) {
283
283
check_attrs ( cx, item. span , item. ident . name , & item. attrs )
284
284
}
@@ -350,21 +350,21 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
350
350
}
351
351
}
352
352
353
- fn check_impl_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx ImplItem < ' _ > ) {
353
+ fn check_impl_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx ImplItem < ' _ > ) {
354
354
if is_relevant_impl ( cx, item) {
355
355
check_attrs ( cx, item. span , item. ident . name , & item. attrs )
356
356
}
357
357
}
358
358
359
- fn check_trait_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx TraitItem < ' _ > ) {
359
+ fn check_trait_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx TraitItem < ' _ > ) {
360
360
if is_relevant_trait ( cx, item) {
361
361
check_attrs ( cx, item. span , item. ident . name , & item. attrs )
362
362
}
363
363
}
364
364
}
365
365
366
366
#[ allow( clippy:: single_match_else) ]
367
- fn check_clippy_lint_names ( cx : & LateContext < ' _ , ' _ > , items : & [ NestedMetaItem ] ) {
367
+ fn check_clippy_lint_names ( cx : & LateContext < ' _ > , items : & [ NestedMetaItem ] ) {
368
368
let lint_store = cx. lints ( ) ;
369
369
for lint in items {
370
370
if_chain ! {
@@ -416,22 +416,22 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
416
416
}
417
417
}
418
418
419
- fn is_relevant_item ( cx : & LateContext < ' _ , ' _ > , item : & Item < ' _ > ) -> bool {
419
+ fn is_relevant_item ( cx : & LateContext < ' _ > , item : & Item < ' _ > ) -> bool {
420
420
if let ItemKind :: Fn ( _, _, eid) = item. kind {
421
421
is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value )
422
422
} else {
423
423
true
424
424
}
425
425
}
426
426
427
- fn is_relevant_impl ( cx : & LateContext < ' _ , ' _ > , item : & ImplItem < ' _ > ) -> bool {
427
+ fn is_relevant_impl ( cx : & LateContext < ' _ > , item : & ImplItem < ' _ > ) -> bool {
428
428
match item. kind {
429
429
ImplItemKind :: Fn ( _, eid) => is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value ) ,
430
430
_ => false ,
431
431
}
432
432
}
433
433
434
- fn is_relevant_trait ( cx : & LateContext < ' _ , ' _ > , item : & TraitItem < ' _ > ) -> bool {
434
+ fn is_relevant_trait ( cx : & LateContext < ' _ > , item : & TraitItem < ' _ > ) -> bool {
435
435
match item. kind {
436
436
TraitItemKind :: Fn ( _, TraitFn :: Required ( _) ) => true ,
437
437
TraitItemKind :: Fn ( _, TraitFn :: Provided ( eid) ) => {
@@ -441,7 +441,7 @@ fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem<'_>) -> bool {
441
441
}
442
442
}
443
443
444
- fn is_relevant_block ( cx : & LateContext < ' _ , ' _ > , tables : & ty:: TypeckTables < ' _ > , block : & Block < ' _ > ) -> bool {
444
+ fn is_relevant_block ( cx : & LateContext < ' _ > , tables : & ty:: TypeckTables < ' _ > , block : & Block < ' _ > ) -> bool {
445
445
if let Some ( stmt) = block. stmts . first ( ) {
446
446
match & stmt. kind {
447
447
StmtKind :: Local ( _) => true ,
@@ -453,7 +453,7 @@ fn is_relevant_block(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, bl
453
453
}
454
454
}
455
455
456
- fn is_relevant_expr ( cx : & LateContext < ' _ , ' _ > , tables : & ty:: TypeckTables < ' _ > , expr : & Expr < ' _ > ) -> bool {
456
+ fn is_relevant_expr ( cx : & LateContext < ' _ > , tables : & ty:: TypeckTables < ' _ > , expr : & Expr < ' _ > ) -> bool {
457
457
match & expr. kind {
458
458
ExprKind :: Block ( block, _) => is_relevant_block ( cx, tables, block) ,
459
459
ExprKind :: Ret ( Some ( e) ) => is_relevant_expr ( cx, tables, e) ,
@@ -473,7 +473,7 @@ fn is_relevant_expr(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, exp
473
473
}
474
474
}
475
475
476
- fn check_attrs ( cx : & LateContext < ' _ , ' _ > , span : Span , name : Name , attrs : & [ Attribute ] ) {
476
+ fn check_attrs ( cx : & LateContext < ' _ > , span : Span , name : Name , attrs : & [ Attribute ] ) {
477
477
if span. from_expansion ( ) {
478
478
return ;
479
479
}
@@ -498,7 +498,7 @@ fn check_attrs(cx: &LateContext<'_, '_>, span: Span, name: Name, attrs: &[Attrib
498
498
}
499
499
}
500
500
501
- fn check_semver ( cx : & LateContext < ' _ , ' _ > , span : Span , lit : & Lit ) {
501
+ fn check_semver ( cx : & LateContext < ' _ > , span : Span , lit : & Lit ) {
502
502
if let LitKind :: Str ( is, _) = lit. kind {
503
503
if Version :: parse ( & is. as_str ( ) ) . is_ok ( ) {
504
504
return ;
0 commit comments