Skip to content

Rustup to *rustc 1.19.0-nightly (0418fa9d3 2017-06-04)* #1814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)*

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.137"
version = "0.0.138"
authors = [
"Manish Goregaokar <[email protected]>",
"Andre Bogus <[email protected]>",
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down
15 changes: 6 additions & 9 deletions clippy_lints/src/utils/higher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new code doesn't check for the desugar. So any code that looks like a for loop will be accepted by this function

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
}
Expand Down