Skip to content

Commit 4b8cf55

Browse files
committed
check deref_expr not from_expansion
1 parent a513173 commit 4b8cf55

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_lints/src/borrow_deref_ref.rs

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ impl LateLintPass<'_> for BorrowDerefRef {
5656
if !e.span.from_expansion();
5757
if let ExprKind::AddrOf(_, Mutability::Not, addrof_expr) = e.kind;
5858
if let ExprKind::Unary(UnOp::Deref, deref_expr) = addrof_expr.kind;
59+
if !deref_expr.span.from_expansion();
5960
if !matches!(deref_expr.kind, ExprKind::Unary(UnOp::Deref, ..) );
6061
let ref_ty = cx.typeck_results().expr_ty(deref_expr);
6162
if let ty::Ref(_, inner_ty, Mutability::Not) = ref_ty.kind();

0 commit comments

Comments
 (0)