From 01cae3fd6d6fea21a6c20ce1437f3e85f41b242a Mon Sep 17 00:00:00 2001 From: mcarton Date: Mon, 5 Jun 2017 21:49:26 +0200 Subject: [PATCH 1/2] Rustup to *rustc 1.19.0-nightly (0418fa9d3 2017-06-04)* --- clippy_lints/src/utils/higher.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/clippy_lints/src/utils/higher.rs b/clippy_lints/src/utils/higher.rs index 494182ae545..5113f1224fe 100644 --- a/clippy_lints/src/utils/higher.rs +++ b/clippy_lints/src/utils/higher.rs @@ -129,16 +129,13 @@ pub fn for_loop(expr: &hir::Expr) -> Option<(&hir::Pat, &hir::Expr, &hir::Expr)> let hir::ExprCall(_, ref iterargs) = iterexpr.node, iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(), let hir::ExprLoop(ref block, _, _) = arms[0].body.node, - block.stmts.is_empty(), - let Some(ref loopexpr) = block.expr, - let hir::ExprMatch(_, ref innerarms, hir::MatchSource::ForLoopDesugar) = loopexpr.node, - innerarms.len() == 2 && innerarms[0].pats.len() == 1, - let hir::PatKind::TupleStruct(_, ref somepats, _) = innerarms[0].pats[0].node, - somepats.len() == 1 + block.expr.is_none(), + let [ ref let_stmt, ref body ] = *block.stmts, + let hir::StmtDecl(ref decl, _) = let_stmt.node, + let hir::DeclLocal(ref decl) = decl.node, + let hir::StmtExpr(ref expr, _) = body.node, ], { - return Some((&somepats[0], - &iterargs[0], - &innerarms[0].body)); + return Some((&*decl.pat, &iterargs[0], expr)); }} None } From a7cbc9c68dac2a52cf15fb20e6bc780554faed7f Mon Sep 17 00:00:00 2001 From: mcarton Date: Mon, 5 Jun 2017 21:52:49 +0200 Subject: [PATCH 2/2] Bump to 0.0.138 --- CHANGELOG.md | 3 +++ Cargo.toml | 4 ++-- clippy_lints/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e66e0019782..befc30cc21a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. +## 0.0.138 — 2017-06-05 +* Update to *rustc 1.19.0-nightly (0418fa9d3 2017-06-04)* + ## 0.0.137 — 2017-06-05 * Update to *rustc 1.19.0-nightly (6684d176c 2017-06-03)* diff --git a/Cargo.toml b/Cargo.toml index 1f50085c624..c36b80b8c78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clippy" -version = "0.0.137" +version = "0.0.138" authors = [ "Manish Goregaokar ", "Andre Bogus ", @@ -31,7 +31,7 @@ test = false [dependencies] # begin automatic update -clippy_lints = { version = "0.0.137", path = "clippy_lints" } +clippy_lints = { version = "0.0.138", path = "clippy_lints" } # end automatic update cargo_metadata = "0.2" diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 4901b662045..320a38e78eb 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clippy_lints" # begin automatic update -version = "0.0.137" +version = "0.0.138" # end automatic update authors = [ "Manish Goregaokar ",