[needless_continue]: lint if the last stmt in for/while/loop is continue, recursively
fixes: #4077
This commit is contained in:
parent
998c780126
commit
e582fcd75d
7 changed files with 174 additions and 38 deletions
|
|
@ -494,7 +494,7 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
|
|||
for (_, node) in cx.tcx.hir().parent_iter(expr.hir_id) {
|
||||
match node {
|
||||
Node::Stmt(_) => return true,
|
||||
Node::Block(..) => continue,
|
||||
Node::Block(..) => {},
|
||||
Node::Item(item) => {
|
||||
if let ItemKind::Fn(_, _, body_id) = &item.kind
|
||||
&& let output_ty = return_ty(cx, item.owner_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue