Merge commit 'f712eb5cdc' into clippy-subtree-update
This commit is contained in:
parent
4847c40c8b
commit
6ced8c33c0
248 changed files with 5023 additions and 900 deletions
|
|
@ -330,10 +330,11 @@ fn suggestion_snippet_for_continue_inside_else(cx: &EarlyContext<'_>, data: &Lin
|
|||
}
|
||||
|
||||
fn check_and_warn(cx: &EarlyContext<'_>, expr: &ast::Expr) {
|
||||
if let ast::ExprKind::Loop(loop_block, ..) = &expr.kind
|
||||
if let ast::ExprKind::Loop(loop_block, loop_label, ..) = &expr.kind
|
||||
&& let Some(last_stmt) = loop_block.stmts.last()
|
||||
&& let ast::StmtKind::Expr(inner_expr) | ast::StmtKind::Semi(inner_expr) = &last_stmt.kind
|
||||
&& let ast::ExprKind::Continue(_) = inner_expr.kind
|
||||
&& let ast::ExprKind::Continue(continue_label) = inner_expr.kind
|
||||
&& compare_labels(loop_label.as_ref(), continue_label.as_ref())
|
||||
{
|
||||
span_lint_and_help(
|
||||
cx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue