@@ -533,7 +533,7 @@ impl<'tcx> LateLintPass<'tcx> for Loops {
533
533
}
534
534
535
535
// check for never_loop
536
- if let ExprKind :: Loop ( ref block, _, _) = expr. kind {
536
+ if let ExprKind :: Loop ( ref block, _, _, _ ) = expr. kind {
537
537
match never_loop_block ( block, expr. hir_id ) {
538
538
NeverLoopResult :: AlwaysBreak => span_lint ( cx, NEVER_LOOP , expr. span , "this loop never actually loops" ) ,
539
539
NeverLoopResult :: MayContinueMainLoop | NeverLoopResult :: Otherwise => ( ) ,
@@ -543,7 +543,7 @@ impl<'tcx> LateLintPass<'tcx> for Loops {
543
543
// check for `loop { if let {} else break }` that could be `while let`
544
544
// (also matches an explicit "match" instead of "if let")
545
545
// (even if the "match" or "if let" is used for declaration)
546
- if let ExprKind :: Loop ( ref block, _, LoopSource :: Loop ) = expr. kind {
546
+ if let ExprKind :: Loop ( ref block, _, LoopSource :: Loop , _ ) = expr. kind {
547
547
// also check for empty `loop {}` statements, skipping those in #[panic_handler]
548
548
if block. stmts . is_empty ( ) && block. expr . is_none ( ) && !is_in_panic_handler ( cx, expr) {
549
549
let msg = "empty `loop {}` wastes CPU cycles" ;
@@ -738,7 +738,7 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
738
738
| ExprKind :: Assign ( ref e1, ref e2, _)
739
739
| ExprKind :: AssignOp ( _, ref e1, ref e2)
740
740
| ExprKind :: Index ( ref e1, ref e2) => never_loop_expr_all ( & mut [ & * * e1, & * * e2] . iter ( ) . cloned ( ) , main_loop_id) ,
741
- ExprKind :: Loop ( ref b, _, _) => {
741
+ ExprKind :: Loop ( ref b, _, _, _ ) => {
742
742
// Break can come from the inner loop so remove them.
743
743
absorb_break ( & never_loop_block ( b, main_loop_id) )
744
744
} ,
@@ -1314,7 +1314,7 @@ impl<'a, 'tcx> Visitor<'tcx> for SameItemPushVisitor<'a, 'tcx> {
1314
1314
fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
1315
1315
match & expr. kind {
1316
1316
// Non-determinism may occur ... don't give a lint
1317
- ExprKind :: Loop ( _ , _ , _ ) | ExprKind :: Match ( _ , _ , _ ) => self . should_lint = false ,
1317
+ ExprKind :: Loop ( .. ) | ExprKind :: Match ( .. ) => self . should_lint = false ,
1318
1318
ExprKind :: Block ( block, _) => self . visit_block ( block) ,
1319
1319
_ => { } ,
1320
1320
}
0 commit comments