about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-07-25 01:04:27 +0400
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-10-09 13:05:53 +0000
commit8ca57b54c19b22b6037b44619e5773a6a378d808 (patch)
tree092bf1ce80a3102f7e7d3b0027eba12c4a6faa9a
parent23a7674e3eb7e860ae59e81acc0699926dd0797c (diff)
downloadrust-8ca57b54c19b22b6037b44619e5773a6a378d808.tar.gz
rust-8ca57b54c19b22b6037b44619e5773a6a378d808.zip
`for_loop_over_fallibles`: don't use `MachineApplicable`
The loop could contain `break;` that won't work with an `if let`
-rw-r--r--compiler/rustc_lint/src/for_loop_over_fallibles.rs2
1 files changed, 1 insertions, 1 deletions
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 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopOverFallibles {
                     (expr.span.with_hi(pat.span.lo()), format!("if let {var}(")),
                     (pat.span.between(arg.span), format!(") = ")),
                 ],
-                Applicability::MachineApplicable,
+                Applicability::MaybeIncorrect,
             );
 
             warn.emit()