Skip to content

Commit f110f34

Browse files
Fix needless_continue FP when match type is not unit or never (#15547)
Closes #14550 Closes #15548 changelog: [`needless_continue`] fix FP when match type is not unit or never
2 parents 0a2eece + 13bd9b5 commit f110f34

File tree

6 files changed

+302
-83
lines changed

6 files changed

+302
-83
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co
619619
store.register_late_pass(|_| Box::new(items_after_statements::ItemsAfterStatements));
620620
store.register_early_pass(|| Box::new(precedence::Precedence));
621621
store.register_late_pass(|_| Box::new(needless_parens_on_range_literals::NeedlessParensOnRangeLiterals));
622-
store.register_early_pass(|| Box::new(needless_continue::NeedlessContinue));
622+
store.register_late_pass(|_| Box::new(needless_continue::NeedlessContinue));
623623
store.register_early_pass(|| Box::new(redundant_else::RedundantElse));
624624
store.register_late_pass(|_| Box::new(create_dir::CreateDir));
625625
store.register_early_pass(|| Box::new(needless_arbitrary_self_type::NeedlessArbitrarySelfType));

clippy_lints/src/loops/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,10 @@ impl<'tcx> LateLintPass<'tcx> for Loops {
871871

872872
while_let_on_iterator::check(cx, expr);
873873

874-
if let Some(higher::While { condition, body, span }) = higher::While::hir(expr) {
874+
if let Some(higher::While {
875+
condition, body, span, ..
876+
}) = higher::While::hir(expr)
877+
{
875878
while_immutable_condition::check(cx, condition, body);
876879
while_float::check(cx, condition);
877880
missing_spin_loop::check(cx, condition, body);

0 commit comments

Comments
 (0)