@@ -461,15 +461,15 @@ fn check_clippy_lint_names(cx: &LateContext<'_>, ident: &str, items: &[NestedMet
461461
462462fn is_relevant_item ( cx : & LateContext < ' _ > , item : & Item < ' _ > ) -> bool {
463463 if let ItemKind :: Fn ( _, _, eid) = item. kind {
464- is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value )
464+ is_relevant_expr ( cx, cx. tcx . typeck_body ( eid) , & cx. tcx . hir ( ) . body ( eid) . value )
465465 } else {
466466 true
467467 }
468468}
469469
470470fn is_relevant_impl ( cx : & LateContext < ' _ > , item : & ImplItem < ' _ > ) -> bool {
471471 match item. kind {
472- ImplItemKind :: Fn ( _, eid) => is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value ) ,
472+ ImplItemKind :: Fn ( _, eid) => is_relevant_expr ( cx, cx. tcx . typeck_body ( eid) , & cx. tcx . hir ( ) . body ( eid) . value ) ,
473473 _ => false ,
474474 }
475475}
@@ -478,31 +478,34 @@ fn is_relevant_trait(cx: &LateContext<'_>, item: &TraitItem<'_>) -> bool {
478478 match item. kind {
479479 TraitItemKind :: Fn ( _, TraitFn :: Required ( _) ) => true ,
480480 TraitItemKind :: Fn ( _, TraitFn :: Provided ( eid) ) => {
481- is_relevant_expr ( cx, cx. tcx . body_tables ( eid) , & cx. tcx . hir ( ) . body ( eid) . value )
481+ is_relevant_expr ( cx, cx. tcx . typeck_body ( eid) , & cx. tcx . hir ( ) . body ( eid) . value )
482482 } ,
483483 _ => false ,
484484 }
485485}
486486
487- fn is_relevant_block ( cx : & LateContext < ' _ > , tables : & ty:: TypeckTables < ' _ > , block : & Block < ' _ > ) -> bool {
487+ fn is_relevant_block ( cx : & LateContext < ' _ > , typeck_results : & ty:: TypeckResults < ' _ > , block : & Block < ' _ > ) -> bool {
488488 block. stmts . first ( ) . map_or (
489- block. expr . as_ref ( ) . map_or ( false , |e| is_relevant_expr ( cx, tables, e) ) ,
489+ block
490+ . expr
491+ . as_ref ( )
492+ . map_or ( false , |e| is_relevant_expr ( cx, typeck_results, e) ) ,
490493 |stmt| match & stmt. kind {
491494 StmtKind :: Local ( _) => true ,
492- StmtKind :: Expr ( expr) | StmtKind :: Semi ( expr) => is_relevant_expr ( cx, tables , expr) ,
495+ StmtKind :: Expr ( expr) | StmtKind :: Semi ( expr) => is_relevant_expr ( cx, typeck_results , expr) ,
493496 _ => false ,
494497 } ,
495498 )
496499}
497500
498- fn is_relevant_expr ( cx : & LateContext < ' _ > , tables : & ty:: TypeckTables < ' _ > , expr : & Expr < ' _ > ) -> bool {
501+ fn is_relevant_expr ( cx : & LateContext < ' _ > , typeck_results : & ty:: TypeckResults < ' _ > , expr : & Expr < ' _ > ) -> bool {
499502 match & expr. kind {
500- ExprKind :: Block ( block, _) => is_relevant_block ( cx, tables , block) ,
501- ExprKind :: Ret ( Some ( e) ) => is_relevant_expr ( cx, tables , e) ,
503+ ExprKind :: Block ( block, _) => is_relevant_block ( cx, typeck_results , block) ,
504+ ExprKind :: Ret ( Some ( e) ) => is_relevant_expr ( cx, typeck_results , e) ,
502505 ExprKind :: Ret ( None ) | ExprKind :: Break ( _, None ) => false ,
503506 ExprKind :: Call ( path_expr, _) => {
504507 if let ExprKind :: Path ( qpath) = & path_expr. kind {
505- tables
508+ typeck_results
506509 . qpath_res ( qpath, path_expr. hir_id )
507510 . opt_def_id ( )
508511 . map_or ( true , |fun_id| !match_def_path ( cx, fun_id, & paths:: BEGIN_PANIC ) )
0 commit comments