]> git.lizzy.rs Git - rust.git/commitdiff
`for_loop_over_fallibles`: don't use `MachineApplicable`
authorMaybe Waffle <waffle.lapkin@gmail.com>
Sun, 24 Jul 2022 21:04:27 +0000 (01:04 +0400)
committerMaybe Waffle <waffle.lapkin@gmail.com>
Sun, 9 Oct 2022 13:05:53 +0000 (13:05 +0000)
The loop could contain `break;` that won't work with an `if let`

compiler/rustc_lint/src/for_loop_over_fallibles.rs

index c8d5586d39f9c958cf23f996b3ae27845ffb2f6c..6870942af941f349a2de68447d94dd76ee1ff7f6 100644 (file)
@@ -113,7 +113,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
                     (expr.span.with_hi(pat.span.lo()), format!("if let {var}(")),
                     (pat.span.between(arg.span), format!(") = ")),
                 ],
-                Applicability::MachineApplicable,
+                Applicability::MaybeIncorrect,
             );
 
             warn.emit()