@@ -275,8 +275,8 @@ declare_lint_pass!(Attributes => [
275
275
BLANKET_CLIPPY_RESTRICTION_LINTS ,
276
276
] ) ;
277
277
278
- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for Attributes {
279
- fn check_attribute ( & mut self , cx : & LateContext < ' a , ' tcx > , attr : & ' tcx Attribute ) {
278
+ impl < ' tcx > LateLintPass < ' tcx > for Attributes {
279
+ fn check_attribute ( & mut self , cx : & LateContext < ' tcx > , attr : & ' tcx Attribute ) {
280
280
if let Some ( items) = & attr. meta_item_list ( ) {
281
281
if let Some ( ident) = attr. ident ( ) {
282
282
let ident = & * ident. as_str ( ) ;
@@ -303,7 +303,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
303
303
}
304
304
}
305
305
306
- fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx Item < ' _ > ) {
306
+ fn check_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx Item < ' _ > ) {
307
307
if is_relevant_item ( cx, item) {
308
308
check_attrs ( cx, item. span , item. ident . name , & item. attrs )
309
309
}
@@ -375,20 +375,20 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
375
375
}
376
376
}
377
377
378
- fn check_impl_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx ImplItem < ' _ > ) {
378
+ fn check_impl_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx ImplItem < ' _ > ) {
379
379
if is_relevant_impl ( cx, item) {
380
380
check_attrs ( cx, item. span , item. ident . name , & item. attrs )
381
381
}
382
382
}
383
383
384
- fn check_trait_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx TraitItem < ' _ > ) {
384
+ fn check_trait_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx TraitItem < ' _ > ) {
385
385
if is_relevant_trait ( cx, item) {
386
386
check_attrs ( cx, item. span , item. ident . name , & item. attrs )
387
387
}
388
388
}
389
389
}
390
390
391
- fn check_clippy_lint_names ( cx : & LateContext < ' _ , ' _ > , ident : & str , items : & [ NestedMetaItem ] ) {
391
+ fn check_clippy_lint_names ( cx : & LateContext < ' _ > , ident : & str , items : & [ NestedMetaItem ] ) {
392
392
fn extract_name ( lint : & NestedMetaItem ) -> Option < SymbolStr > {
393
393
if_chain ! {
394
394
if let Some ( meta_item) = lint. meta_item( ) ;
@@ -455,22 +455,22 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, ident: &str, items: &[Neste
455
455
}
456
456
}
457
457
458
- fn is_relevant_item ( cx : & LateContext < ' _ , ' _ > , item : & Item < ' _ > ) -> bool {
458
+ fn is_relevant_item ( cx : & LateContext < ' _ > , item : & Item < ' _ > ) -> bool {
459
459
if let ItemKind :: Fn ( _, _, eid) = item. kind {
460
460
is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value )
461
461
} else {
462
462
true
463
463
}
464
464
}
465
465
466
- fn is_relevant_impl ( cx : & LateContext < ' _ , ' _ > , item : & ImplItem < ' _ > ) -> bool {
466
+ fn is_relevant_impl ( cx : & LateContext < ' _ > , item : & ImplItem < ' _ > ) -> bool {
467
467
match item. kind {
468
468
ImplItemKind :: Fn ( _, eid) => is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value ) ,
469
469
_ => false ,
470
470
}
471
471
}
472
472
473
- fn is_relevant_trait ( cx : & LateContext < ' _ , ' _ > , item : & TraitItem < ' _ > ) -> bool {
473
+ fn is_relevant_trait ( cx : & LateContext < ' _ > , item : & TraitItem < ' _ > ) -> bool {
474
474
match item. kind {
475
475
TraitItemKind :: Fn ( _, TraitFn :: Required ( _) ) => true ,
476
476
TraitItemKind :: Fn ( _, TraitFn :: Provided ( eid) ) => {
@@ -480,7 +480,7 @@ fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem<'_>) -> bool {
480
480
}
481
481
}
482
482
483
- fn is_relevant_block ( cx : & LateContext < ' _ , ' _ > , tables : & ty:: TypeckTables < ' _ > , block : & Block < ' _ > ) -> bool {
483
+ fn is_relevant_block ( cx : & LateContext < ' _ > , tables : & ty:: TypeckTables < ' _ > , block : & Block < ' _ > ) -> bool {
484
484
if let Some ( stmt) = block. stmts . first ( ) {
485
485
match & stmt. kind {
486
486
StmtKind :: Local ( _) => true ,
@@ -492,7 +492,7 @@ fn is_relevant_block(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, bl
492
492
}
493
493
}
494
494
495
- fn is_relevant_expr ( cx : & LateContext < ' _ , ' _ > , tables : & ty:: TypeckTables < ' _ > , expr : & Expr < ' _ > ) -> bool {
495
+ fn is_relevant_expr ( cx : & LateContext < ' _ > , tables : & ty:: TypeckTables < ' _ > , expr : & Expr < ' _ > ) -> bool {
496
496
match & expr. kind {
497
497
ExprKind :: Block ( block, _) => is_relevant_block ( cx, tables, block) ,
498
498
ExprKind :: Ret ( Some ( e) ) => is_relevant_expr ( cx, tables, e) ,
@@ -512,7 +512,7 @@ fn is_relevant_expr(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, exp
512
512
}
513
513
}
514
514
515
- fn check_attrs ( cx : & LateContext < ' _ , ' _ > , span : Span , name : Name , attrs : & [ Attribute ] ) {
515
+ fn check_attrs ( cx : & LateContext < ' _ > , span : Span , name : Name , attrs : & [ Attribute ] ) {
516
516
if span. from_expansion ( ) {
517
517
return ;
518
518
}
@@ -537,7 +537,7 @@ fn check_attrs(cx: &LateContext<'_, '_>, span: Span, name: Name, attrs: &[Attrib
537
537
}
538
538
}
539
539
540
- fn check_semver ( cx : & LateContext < ' _ , ' _ > , span : Span , lit : & Lit ) {
540
+ fn check_semver ( cx : & LateContext < ' _ > , span : Span , lit : & Lit ) {
541
541
if let LitKind :: Str ( is, _) = lit. kind {
542
542
if Version :: parse ( & is. as_str ( ) ) . is_ok ( ) {
543
543
return ;
0 commit comments