Skip to content

Commit c4ab59e

Browse files
committed
for_loop_over_fallibles: don't use MachineApplicable
The loop could contain `break;` that won't work with an `if let`
1 parent 34815a9 commit c4ab59e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_lint/src/for_loop_over_fallibles.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopOverFallibles {
113113
(expr.span.with_hi(pat.span.lo()), format!("if let {var}(")),
114114
(pat.span.between(arg.span), format!(") = ")),
115115
],
116-
Applicability::MachineApplicable,
116+
Applicability::MaybeIncorrect,
117117
);
118118

119119
warn.emit()

0 commit comments

Comments
 (0)