Skip to content

Commit 31b1cce

Browse files
committed
Index, Unary
1 parent 3e62f7d commit 31b1cce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/borrow_deref_ref.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ impl LateLintPass<'_> for BorrowDerefRef {
6262
then{
6363

6464
if let Some(parent_expr) = get_parent_expr(cx, e){
65-
if matches!(deref_target.kind, ExprKind::Path(..) | ExprKind::Field(..)) {
65+
if matches!(deref_target.kind, ExprKind::Path(..)
66+
| ExprKind::Field(..)
67+
| ExprKind::Index(..)
68+
| ExprKind::Unary(UnOp::Deref, ..)) {
6669
if matches!(parent_expr.kind, ExprKind::AddrOf(_, Mutability::Mut, _)) {
6770
return;
6871
}

0 commit comments

Comments
 (0)