From: Maybe Waffle Date: Sun, 24 Jul 2022 21:04:27 +0000 (+0400) Subject: `for_loop_over_fallibles`: don't use `MachineApplicable` X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=8ca57b54c19b22b6037b44619e5773a6a378d808;p=rust.git `for_loop_over_fallibles`: don't use `MachineApplicable` The loop could contain `break;` that won't work with an `if let` --- diff --git a/compiler/rustc_lint/src/for_loop_over_fallibles.rs b/compiler/rustc_lint/src/for_loop_over_fallibles.rs index c8d5586d39f..6870942af94 100644 --- a/compiler/rustc_lint/src/for_loop_over_fallibles.rs +++ b/compiler/rustc_lint/src/for_loop_over_fallibles.rs @@ -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()