Skip to content

Commit d1dcd91

Browse files
committed
equatable_if_let: Check HIR tree before checking for macros.
1 parent 441500b commit d1dcd91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/equatable_if_let.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ fn is_structural_partial_eq<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, other: T
7070

7171
impl<'tcx> LateLintPass<'tcx> for PatternEquality {
7272
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
73-
if !in_external_macro(cx.sess(), expr.span)
74-
&& let ExprKind::Let(let_expr) = expr.kind
73+
if let ExprKind::Let(let_expr) = expr.kind
7574
&& unary_pattern(let_expr.pat)
75+
&& !in_external_macro(cx.sess(), expr.span)
7676
{
7777
let exp_ty = cx.typeck_results().expr_ty(let_expr.init);
7878
let pat_ty = cx.typeck_results().pat_ty(let_expr.pat);

0 commit comments

Comments
 (0)