Skip to content

Rustup to rustc 1.40.0-nightly (702b45e40 2019-10-01) #4604

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 1 commit into from
Oct 1, 2019
Merged
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
18 changes: 10 additions & 8 deletions clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,21 @@ declare_lint_pass!(Loops => [
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Loops {
#[allow(clippy::too_many_lines)]
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
if let Some((pat, arg, body)) = higher::for_loop(expr) {
// we don't want to check expanded macros
// this check is not at the top of the function
// since higher::for_loop expressions are marked as expansions
if body.span.from_expansion() {
return;
}
check_for_loop(cx, pat, arg, body, expr);
}

// we don't want to check expanded macros
if expr.span.from_expansion() {
return;
}

if let Some((pat, arg, body)) = higher::for_loop(expr) {
check_for_loop(cx, pat, arg, body, expr);
}

// check for never_loop
if let ExprKind::Loop(ref block, _, _) = expr.kind {
match never_loop_block(block, expr.hir_id) {
Expand Down Expand Up @@ -1039,10 +1045,6 @@ fn check_for_loop_range<'a, 'tcx>(
body: &'tcx Expr,
expr: &'tcx Expr,
) {
if expr.span.from_expansion() {
return;
}

if let Some(higher::Range {
start: Some(start),
ref end,
Expand Down