Skip to content

Commit 3cbf126

Browse files
authored
Merge pull request #1819 from Manishearth/fix-1814
Check for `for` loop desugaring in highering
2 parents 07c25ea + bb0b597 commit 3cbf126

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/utils/higher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn is_from_for_desugar(decl: &hir::Decl) -> bool {
125125
/// `for pat in arg { body }` becomes `(pat, arg, body)`.
126126
pub fn for_loop(expr: &hir::Expr) -> Option<(&hir::Pat, &hir::Expr, &hir::Expr)> {
127127
if_let_chain! {[
128-
let hir::ExprMatch(ref iterexpr, ref arms, _) = expr.node,
128+
let hir::ExprMatch(ref iterexpr, ref arms, hir::MatchSource::ForLoopDesugar) = expr.node,
129129
let hir::ExprCall(_, ref iterargs) = iterexpr.node,
130130
iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(),
131131
let hir::ExprLoop(ref block, _, _) = arms[0].body.node,

0 commit comments

Comments
 (0)