Skip to content

Commit 9495686

Browse files
committed
Update clippy for the ast TryBlock change
1 parent 8cc9c5e commit 9495686

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ fn ident_difference_expr_with_base_location(
545545
| (Field(_, _), Field(_, _))
546546
| (AssignOp(_, _, _), AssignOp(_, _, _))
547547
| (Assign(_, _, _), Assign(_, _, _))
548-
| (TryBlock(_), TryBlock(_))
548+
| (TryBlock(_, _), TryBlock(_, _))
549549
| (Await(_, _), Await(_, _))
550550
| (Gen(_, _, _, _), Gen(_, _, _, _))
551551
| (Block(_, _), Block(_, _))

clippy_utils/src/ast_utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
199199
) => eq_label(ll.as_ref(), rl.as_ref()) && eq_pat(lp, rp) && eq_expr(li, ri) && eq_block(lt, rt) && lk == rk,
200200
(Loop(lt, ll, _), Loop(rt, rl, _)) => eq_label(ll.as_ref(), rl.as_ref()) && eq_block(lt, rt),
201201
(Block(lb, ll), Block(rb, rl)) => eq_label(ll.as_ref(), rl.as_ref()) && eq_block(lb, rb),
202-
(TryBlock(l), TryBlock(r)) => eq_block(l, r),
202+
(TryBlock(lb, lt), TryBlock(rb, rt)) => eq_block(lb, rb) && both(lt.as_deref(), rt.as_deref(), eq_ty),
203203
(Yield(l), Yield(r)) => eq_expr_opt(l.expr().map(Box::as_ref), r.expr().map(Box::as_ref)) && l.same_kind(r),
204204
(Ret(l), Ret(r)) => eq_expr_opt(l.as_deref(), r.as_deref()),
205205
(Break(ll, le), Break(rl, re)) => {

0 commit comments

Comments
 (0)